forked from klembot/twinejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
37 lines (36 loc) · 989 Bytes
/
vite.config.ts
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
import react from '@vitejs/plugin-react-swc';
import browserslistToEsbuild from 'browserslist-to-esbuild';
import {defineConfig} from 'vite';
import checker from 'vite-plugin-checker';
import {nodePolyfills} from 'vite-plugin-node-polyfills';
import packageJson from './package.json';
export default defineConfig({
base: './',
build: {
outDir: 'dist/web',
target: browserslistToEsbuild(['>0.2%', 'not dead', 'not op_mini all'])
},
define: {
// Make app name and version available to code.
// https://stackoverflow.com/a/74860417/7569568
'process.env.VITE_APP_NAME': JSON.stringify(packageJson.name),
'process.env.VITE_APP_VERSION': JSON.stringify(packageJson.version)
},
plugins: [
checker({
eslint: {lintCommand: 'eslint src'},
overlay: {
initialIsOpen: false
},
typescript: true
}),
nodePolyfills(
// We only need a `global` injected, for CodeMirror.
{include: [], globals: {global: true}}
),
react()
],
server: {
open: true
}
});