mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
Be able to set optimizeDeps options in gradio.config.js (#9091)
* Add code * add changeset * build * Remove unused import --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
13010fdfd7
commit
bbbd1f5ebe
5
.changeset/poor-years-sin.md
Normal file
5
.changeset/poor-years-sin.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@gradio/preview": minor
|
||||
---
|
||||
|
||||
feat:Be able to set optimizeDeps options in gradio.config.js
|
@ -40,7 +40,8 @@ export async function make_build({
|
||||
},
|
||||
build: {
|
||||
target: []
|
||||
}
|
||||
},
|
||||
optimizeDeps: {}
|
||||
};
|
||||
|
||||
if (
|
||||
@ -54,6 +55,7 @@ export async function make_build({
|
||||
component_config.plugins = m.default.plugins || [];
|
||||
component_config.svelte.preprocess = m.default.svelte?.preprocess || [];
|
||||
component_config.build.target = m.default.build?.target || "modules";
|
||||
component_config.optimizeDeps = m.default.optimizeDeps || {};
|
||||
}
|
||||
|
||||
const exports: string[][] = [
|
||||
|
@ -60,6 +60,7 @@ export async function create_server({
|
||||
build: {
|
||||
target: config.build.target
|
||||
},
|
||||
optimizeDeps: config.optimizeDeps,
|
||||
plugins: [
|
||||
...plugins(config),
|
||||
make_gradio_plugin({
|
||||
@ -122,6 +123,7 @@ export interface ComponentConfig {
|
||||
build: {
|
||||
target: string | string[];
|
||||
};
|
||||
optimizeDeps: object;
|
||||
}
|
||||
|
||||
async function generate_imports(
|
||||
@ -147,7 +149,8 @@ async function generate_imports(
|
||||
},
|
||||
build: {
|
||||
target: []
|
||||
}
|
||||
},
|
||||
optimizeDeps: {}
|
||||
};
|
||||
|
||||
await Promise.all(
|
||||
@ -163,6 +166,7 @@ async function generate_imports(
|
||||
component_config.plugins = m.default.plugins || [];
|
||||
component_config.svelte.preprocess = m.default.svelte?.preprocess || [];
|
||||
component_config.build.target = m.default.build?.target || "modules";
|
||||
component_config.optimizeDeps = m.default.optimizeDeps || {};
|
||||
} else {
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user