-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
46 lines (41 loc) · 1.46 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
import * as path from 'path';
import { defineConfig } from 'vite';
import viteCompression from 'vite-plugin-compression';
import basicSsl from '@vitejs/plugin-basic-ssl'
import vue from '@vitejs/plugin-vue';
export default defineConfig(async ({ command }) => {
const { needlePlugins, useGzip, loadConfig } = await import("@needle-tools/engine/plugins/vite/index.js");
const needleConfig = await loadConfig();
return {
base: "./",
// publicDir: "./assets", // this would copy all assets in the outdir (but not inside assets)
assetsInclude: ['*'],
// logLevel: 'info',
plugins: [
basicSsl(),
vue(),
useGzip(needleConfig) ? viteCompression({ deleteOriginFile: true }) : null,
needlePlugins(command, needleConfig),
],
server: {
// hmr: false,
// watch: ["generated/**"]
https: true,
proxy: { // workaround: specifying a proxy skips HTTP2 which is currently problematic in Vite since it causes session memory timeouts.
'https://localhost:3000': 'https://localhost:3000'
},
watch: {
awaitWriteFinish: {
stabilityThreshold: 500,
pollInterval: 1000
}
},
strictPort: true,
port: 3000,
},
build: {
outDir: "./dist",
emptyOutDir: true
}
}
});