forked from MikronMIK32/web-configurator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
36 lines (33 loc) · 851 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
import react from '@vitejs/plugin-react-swc';
import dotenv from 'dotenv';
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import svgr from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';
dotenv.config();
const ASSET_URL = process.env.ASSET_URL || '';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
EnvironmentPlugin(['ASSET_URL', 'BASE_URL', 'USE_LOCAL_STORAGE', 'API_HOST']),
svgr({
svgrOptions: {},
}),
tsconfigPaths(),
react({
jsxImportSource: '@emotion/react',
plugins: [['@swc/plugin-emotion', {}]],
}),
],
server: {
port: 3000,
},
base: ASSET_URL,
esbuild: {
define: {
this: 'window',
},
jsxFactory: `jsx`,
// jsxInject: `import { jsx } from '@emotion/react'`,
},
});