-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.js
45 lines (43 loc) · 1.12 KB
/
vite.config.js
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
const { resolve } = require('path');
const fg = require('fast-glob');
import { defineConfig } from 'vite';
export default defineConfig({
base: "/static/",
root: resolve('./frontend/'),
resolve:{
alias:{
'@' : resolve('./frontend')
},
},
build: {
manifest: true, // adds a manifest.json
rollupOptions: {
input: {
main: resolve(__dirname, './frontend/js/main.ts'),
}
},
outDir: '../sampleapp/static', // puts the manifest.json in PROJECT_ROOT/static/
},
plugins: [
// {
// name: 'watch-external', // https://stackoverflow.com/questions/63373804/rollup-watch-include-directory/63548394#63548394
// async buildStart(){
// const files = await fg(['sampleapp/templates/**/*']);
// for(let file of files){
// this.addWatchFile(file);
// }
// }
// },
// {
// name: 'reloadHtml',
// handleHotUpdate({ file, server }) {
// if (file.endsWith('.html')) {
// server.ws.send({
// type: 'full-reload',
// path: '*',
// });
// }
// },
// }
],
});