mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
Gradio custom component dev mode now detects changes to Example.svelte file (#6457)
* WIP * fix * WIP * Remove console log * add changeset * add changeset * use strict --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
58e3ca8260
commit
d00fcf89d1
7
.changeset/tangy-chicken-tell.md
Normal file
7
.changeset/tangy-chicken-tell.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
"@gradio/app": patch
|
||||
"@gradio/preview": patch
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Gradio custom component dev mode now detects changes to Example.svelte file
|
@ -9,7 +9,6 @@ export async function load_component({ api_url, name, id, variant }) {
|
||||
...(!comps ? {} : comps)
|
||||
};
|
||||
try {
|
||||
//@ts-ignore
|
||||
const c = await (
|
||||
_component_map?.[id]?.[variant] || // for dev mode custom components
|
||||
_component_map?.[name]?.[variant]
|
||||
|
@ -122,13 +122,13 @@ function generate_imports(component_dir: string, root: string): string {
|
||||
);
|
||||
|
||||
const exports: Record<string, string | undefined> = {
|
||||
component: pkg.exports["."] as string,
|
||||
exmaple: pkg.exports["./example"] as string
|
||||
component: pkg.exports["."],
|
||||
example: pkg.exports["./example"]
|
||||
};
|
||||
|
||||
const example = exports.example
|
||||
? `example: () => import("${to_posix(
|
||||
join(component.frontend_dir, "example")
|
||||
join(component.frontend_dir, exports.example)
|
||||
)}"),\n`
|
||||
: "";
|
||||
return `${acc}"${component.component_class_id}": {
|
||||
|
Loading…
Reference in New Issue
Block a user