-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
52 lines (51 loc) · 1.31 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import topLevelAwait from 'vite-plugin-top-level-await';
import wasm from 'vite-plugin-wasm';
export default defineConfig({
base: '/webgpu-embed-demo/',
build: {
outDir: 'dist',
minify: false,
rollupOptions: {
input: {
main: 'index.html',
// sw: 'sw.ts'
},
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name?.endsWith('.wasm')) {
return 'assets/[name][extname]';
}
return 'assets/[name].[hash][extname]';
}
}
// entryFileNames: (chunk) => {
// if (chunk.name === 'sw') {
// return 'sw.js';
// }
// return '[name].[hash].js';
// }
// }
}
},
optimizeDeps: {
exclude: ['@xenova/transformers']
},
plugins: [
wasm(), topLevelAwait(),
viteStaticCopy({
targets: [
{
src: 'node_modules/onnxruntime-web/dist/*.wasm',
dest: 'wasm'
}
]
})
],
server: {
fs: {
deny: ['models/*', 'models/Xenova/bge-m3/config.json', '/models/Xenova/bge-m3/config.json'],
},
}
});