-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
26 lines (25 loc) · 941 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
import { defineConfig } from 'vite';
import viteCompression from 'vite-plugin-compression';
export default defineConfig(async ({ command }) => {
const { needlePlugins, useGzip, loadConfig } = await import("@needle-tools/engine/plugins/vite/index.js");
const needleConfig = await loadConfig();
return {
base: "./",
plugins: [
useGzip(needleConfig) ? viteCompression({ deleteOriginFile: true }) : null,
needlePlugins(command, needleConfig),
],
server: {
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'
},
strictPort: true,
port: 3000,
},
build: {
outDir: "./dist",
emptyOutDir: true,
keepNames: true,
}
}
});