Skip to content

Commit b42df92

Browse files
Update vite config so that production build works correctly
1 parent 29416ed commit b42df92

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vite.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { fileURLToPath } from 'url';
99
const PYODIDE_EXCLUDE = [
1010
'!**/*.{md,html}',
1111
'!**/*.d.ts',
12-
'!**/*.whl',
12+
// Need to include .whl files or micropip won't load correctly
13+
// '!**/*.whl',
1314
'!**/node_modules',
1415
];
1516

@@ -19,15 +20,16 @@ export function viteStaticCopyPyodide() {
1920
targets: [
2021
{
2122
src: [join(pyodideDir, '*')].concat(PYODIDE_EXCLUDE),
22-
dest: 'assets',
23+
// Don't export to 'assets', or we'll get a 404 in production
24+
dest: '_app/immutable/nodes',
2325
},
2426
],
2527
});
2628
}
2729

2830

2931
export default defineConfig({
30-
plugins: [sveltekit(), viteStaticCopyPyodide()],
32+
plugins: [viteStaticCopyPyodide(), sveltekit()],
3133
optimizeDeps: { exclude: ["pyodide"] },
3234
test: {
3335
workspace: [{

0 commit comments

Comments
 (0)