-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
35 lines (31 loc) · 1.15 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
import { defineConfig } from 'vite';
import viteCompression from 'vite-plugin-compression';
import react from '@vitejs/plugin-react'
import basicSsl from '@vitejs/plugin-basic-ssl'
const isCIEnvironment = process.env.CI !== undefined;
export default defineConfig(async (command) => {
const { needlePlugins, useGzip, loadConfig } = await import("@needle-tools/engine/plugins/vite/index.js");
const needleConfig = await loadConfig();
return {
base: "./",
assetsInclude: ['*'],
plugins: [
react(),
basicSsl(),
useGzip(needleConfig) && !isCIEnvironment ? viteCompression({ deleteOriginFile: true }) : null,
needlePlugins(command, needleConfig),
],
server: {
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'
},
strictPort: true,
port: 3000,
},
build: {
outDir: "./dist",
emptyOutDir: true,
}
}
});