mirror of
https://github.com/p-stream/p-stream.git
synced 2026-01-11 20:10:32 +00:00
fix: configure Vite to handle WASM files from dependencies
- Add assetsInclude config to treat WASM as assets - Prevent WASM files from being inlined as base64 with assetsInlineLimit This ensures WASM files from dependencies are properly served as separate assets instead of being embedded as data URLs.
This commit is contained in:
parent
85421a881d
commit
236ed5b1ea
1 changed files with 9 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ export default defineConfig(({ mode }) => {
|
|||
const env = loadEnv(mode, process.cwd());
|
||||
return {
|
||||
base: env.VITE_BASE_URL || "/",
|
||||
assetsInclude: ['**/*.wasm'],
|
||||
plugins: [
|
||||
million.vite({ auto: true, mute: true }),
|
||||
handlebars({
|
||||
|
|
@ -123,6 +124,14 @@ export default defineConfig(({ mode }) => {
|
|||
|
||||
build: {
|
||||
sourcemap: mode !== "production",
|
||||
assetsInlineLimit: (filePath: string) => {
|
||||
// Never inline WASM files
|
||||
if (filePath.endsWith('.wasm')) {
|
||||
return false;
|
||||
}
|
||||
// Use default 4KB limit for other assets
|
||||
return undefined;
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id: string) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue