mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Fix HMR issue with customElements
This commit is contained in:
+1
-1
@@ -2,6 +2,6 @@
|
||||
set -e
|
||||
|
||||
npx tsc --noEmit
|
||||
npx svelte-check --tsconfig tsconfig.json --fail-on-warnings
|
||||
npx svelte-check --tsconfig tsconfig.json --fail-on-warnings --compiler-warnings missing-custom-element-compile-options:ignore
|
||||
npx eslint --cache --cache-location node_modules/.cache/eslint --max-warnings 0 .
|
||||
npx prettier "**/*.@(ts|js|svelte|json|css|html|yml)" --ignore-path .gitignore --check --cache
|
||||
|
||||
@@ -2,7 +2,4 @@ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||
|
||||
export default {
|
||||
preprocess: vitePreprocess(),
|
||||
compilerOptions: {
|
||||
customElement: true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,6 +14,16 @@ export default defineConfig({
|
||||
},
|
||||
plugins: [
|
||||
svelte({
|
||||
// Reference: https://github.com/sveltejs/vite-plugin-svelte/issues/270#issuecomment-1033190138
|
||||
experimental: {
|
||||
dynamicCompileOptions({ filename }) {
|
||||
if (path.basename(filename) === "Clipboard.svelte") {
|
||||
return {
|
||||
customElement: true,
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
compilerOptions: { dev: process.env.NODE_ENV !== "production" },
|
||||
}),
|
||||
configureDevServer(),
|
||||
|
||||
Reference in New Issue
Block a user