-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathvite.config.js
More file actions
61 lines (56 loc) · 1.59 KB
/
Copy pathvite.config.js
File metadata and controls
61 lines (56 loc) · 1.59 KB
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
53
54
55
56
57
58
59
60
61
import { defineConfig } from 'vite';
import copy from 'rollup-plugin-copy';
const s_PACKAGE_ID = 'modules/sheet-only';
export default defineConfig({
root: 'src',
base: `/${s_PACKAGE_ID}/`,
publicDir: false,
server: {
port: 30001,
open: '/game',
proxy: {
// Serves static files from main Foundry server.
[`^(/${s_PACKAGE_ID}/(assets|lang|packs|templates))`]: 'http://localhost:30000',
// All other paths besides package ID path are served from main Foundry server.
[`^(?!/${s_PACKAGE_ID}/)`]: 'http://localhost:30000',
// Enable socket.io from main Foundry server.
'/socket.io': {target: 'ws://localhost:30000', ws: true}
}
},
build: {
outDir: __dirname + "/dist",
emptyOutDir: true,
sourcemap: true,
minify: false,
rollupOptions: {
input: 'src/index.js',
output: {
entryFileNames: 'index.js',
assetFileNames: (assetInfo) => {
// Rename the CSS file to style.css and place it in the root
if (assetInfo.name.endsWith('.css')) return 'style.css';
// Keep other assets in the assets folder
return 'assets/[name][extname]';
}
},
plugins: [
copy({
targets: [
{ src: 'module.json', dest: 'dist/'},
{ src: 'LICENSE', dest: 'dist/'},
{ src: 'templates/*', dest: 'dist/templates'},
{ src: 'lang/*', dest: 'dist/lang'},
],
hook: 'writeBundle',
}),
],
},
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
},
},
});