Fix dev mode Vite imports

This commit is contained in:
Jade Ellis
2024-05-03 13:29:44 +01:00
parent f36f711de9
commit ae1b0855ba
+8 -2
View File
@@ -4,7 +4,7 @@ import { ViteImageOptimizer } from "vite-plugin-image-optimizer";
import dynamicImport from 'vite-plugin-dynamic-import' import dynamicImport from 'vite-plugin-dynamic-import'
import typeAsJsonSchemaPlugin from "rollup-plugin-type-as-json-schema"; import typeAsJsonSchemaPlugin from "rollup-plugin-type-as-json-schema";
import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'; import dynamicImportVars from '@rollup/plugin-dynamic-import-vars';
import path from "node:path";
import { mdsvex } from 'mdsvex'; import { mdsvex } from 'mdsvex';
import mdsvexConfig from "./mdsvex.config.js"; import mdsvexConfig from "./mdsvex.config.js";
import { extname } from 'node:path'; import { extname } from 'node:path';
@@ -26,7 +26,7 @@ function mdsvex_transform() {
export default defineConfig({ export default defineConfig({
resolve: { resolve: {
alias: { alias: {
"Notes": "node_modules/Notes" "Notes": path.join(__dirname, "node_modules/Notes")
} }
}, },
plugins: [ plugins: [
@@ -37,6 +37,12 @@ export default defineConfig({
// mdsvex_transform(), // mdsvex_transform(),
sveltekit(), sveltekit(),
dynamicImport({ dynamicImport({
filter(id) {
if (id.includes('node_modules/Notes')) {
return true
}
}
}), }),
// dynamicImportVars({ // dynamicImportVars({
// // options // // options