-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
29 lines (28 loc) · 819 Bytes
/
Copy pathvite.config.ts
File metadata and controls
29 lines (28 loc) · 819 Bytes
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
import { defineConfig } from 'vite';
export default defineConfig({
// Relative base so the Web Worker URL resolves alongside dist/grim-arithmetic.js
// when Foundry serves the module from /modules/grim-arithmetic/ rather than
// a host-root. Without this Vite emits "/assets/simulation.worker-*.js" which
// Foundry resolves against the server root and 404s.
base: './',
build: {
lib: {
entry: 'src/main.ts',
name: 'GrimArithmetic',
formats: ['es'],
fileName: () => 'grim-arithmetic.js'
},
outDir: 'dist',
emptyOutDir: true,
sourcemap: process.env.NODE_ENV !== 'production',
rollupOptions: {
output: {
entryFileNames: 'grim-arithmetic.js',
assetFileNames: 'grim-arithmetic.[ext]'
}
}
},
worker: {
format: 'es'
}
});