-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
45 lines (39 loc) · 1017 Bytes
/
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
import path from 'path';
const SRC_DIR = path.resolve(__dirname, './src');
const PUBLIC_DIR = path.resolve(__dirname, './public');
const BUILD_DIR = path.resolve(__dirname, './www',);
const HOST = process.env.MONACA_SERVER_HOST || '0.0.0.0';
export default async () => {
const { svelte } = await import('@sveltejs/vite-plugin-svelte');
return {
plugins: [
svelte(),
],
root: SRC_DIR,
base: '',
publicDir: PUBLIC_DIR,
build: {
outDir: BUILD_DIR,
target: ['es2017'], // support Moncaca Localkit (older browsers)
assetsInlineLimit: 0,
emptyOutDir: false,
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`
}
},
cssMinify: false, // support Moncaca Localkit (older browsers)
},
resolve: {
alias: {
'@': SRC_DIR,
},
},
server: {
host: HOST,
port: 8080,
},
};
}