-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
53 lines (51 loc) · 1.44 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
46
47
48
49
50
51
52
53
import {resolve} from 'path';
import {svelte} from '@sveltejs/vite-plugin-svelte'
import {defineConfig} from "vite";
import routify from '@roxi/routify/vite-plugin'
let static_url = "/static/dist";
if ( process.env.NODE_ENV == "development" ) {
static_url = "/static/"
}
export default defineConfig({
plugins: [
svelte(),
routify({
routifyDir : "./assets/.routify", //change the default routify dir path
routesDir : "./assets/src/pages", //change the default routify routes
rootComponent:"./assets/src/App.svelte", //load the custom app.svelte
clearRoutifyDir:true,
mainEntryPoint:"./assets/src/main.js", // routify entry point
render : {
ssr : true,
}
})
],
root: resolve('./assets'),
base: static_url,
server: {
host: 'localhost',
port: 5173,
open: false,
watch: {
usePolling: true,
disableGlobbing: false,
},
},
resolve: {
extensions: ['.js', '.json', '.svelte', '.ts', '.tsx', '.jsx'],
},
build: {
outDir: resolve('./static/dist'),
assetsDir: '',
manifest: true,
emptyOutDir: true,
rollupOptions: {
input: {
main: resolve('./assets/src/main.js'),
},
output: {
chunkFileNames: undefined,
},
},
},
});