-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
51 lines (50 loc) · 1.26 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { defineConfig, loadEnv } from 'vite';
import eslint2 from 'vite-plugin-eslint2';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import basicSsl from '@vitejs/plugin-basic-ssl';
import babelPluginFormatjs from 'babel-plugin-formatjs';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const open = env.OPEN_BROWSER === 'false' ? false : true;
return {
build: {
rollupOptions: {
output: {
manualChunks: {
'maplibre-gl': ['maplibre-gl'],
'react-map-gl': ['react-map-gl/maplibre'],
react: ['react', 'react-dom/client', 'react-redux', 'react-intl'],
'@nivo': ['@nivo/line'],
},
},
},
outDir: 'build',
},
plugins: [
svgr(),
react({
babel: {
plugins: [
[
babelPluginFormatjs,
{
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
},
],
],
},
}),
eslint2(),
basicSsl(),
],
server: {
port: 3000,
open,
proxy: {
'/api/v1': 'https://api-staging.bikehopper.org',
},
},
};
});