diff --git a/demo/CodeGen.vue b/demo/CodeGen.vue index 08cbfb0..3793bd9 100644 --- a/demo/CodeGen.vue +++ b/demo/CodeGen.vue @@ -78,7 +78,11 @@ const transformedCode = ref(""); const transformErrors = ref([]); onMounted(async () => { - await initialize({ wasmURL }); + // prevent multiple initializations during HMR + if (!window.__esbuildInitialized) { + await initialize({ wasmURL }); + window.__esbuildInitialized = true; + } initializing.value = false; diff --git a/demo/data/logo.js b/demo/data/logo.js index 6947e3d..017578b 100644 --- a/demo/data/logo.js +++ b/demo/data/logo.js @@ -20,10 +20,8 @@ export default { }, shape: `path://${d}`, label: { - normal: { - formatter() { - return ""; - }, + formatter() { + return ""; }, }, itemStyle: { diff --git a/demo/data/radar.ts b/demo/data/radar.ts index 8d00c21..6cd8bea 100644 --- a/demo/data/radar.ts +++ b/demo/data/radar.ts @@ -27,6 +27,7 @@ export const useScoreStore = defineStore("store", () => { fontWeight: 300, }, radar: { + splitNumber: 4, indicator: scores.value.map(({ name, max }, index) => { if (index === activeIndex) { return { name, max, color: "goldenrod" };