forked from sig-gis/comimo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
61 lines (60 loc) · 1.59 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import resolve from "@rollup/plugin-node-resolve";
import babel from "@rollup/plugin-babel";
// https://vitejs.dev/config/
// TODO add conditions (prod/dev)
export default defineConfig({
server: {
origin: "http://127.0.0.1:8080",
hmr: {
overlay: false,
},
},
build: {
chunkSizeWarningLimit: 1000,
minify: false,
manifest: true,
sourcemap: true,
plugins: [resolve(), babel({ exclude: "node_modules/**" })],
rollupOptions: {
// external: ["mapbox-gl"],
preserveEntrySignatures: "exports-only",
input: [
// "node_modules/react-refresh/",
"src/js/admin.jsx",
"src/js/collect.jsx",
"src/js/home.jsx",
"src/js/login.jsx",
"src/js/pageNotFound.jsx",
"src/js/passwordRequest.jsx",
"src/js/passwordReset.jsx",
"src/js/register.jsx",
"src/js/userAccount.jsx",
"src/js/verifyUser.jsx",
],
output: {
// compact: false,
// sourcemap: true,
// entryFileNames: "[name].js",
// preserveModules: true,
// minifyInternalExports: false,
dir: "dist/public",
},
},
},
plugins: [
react({
fastRefresh: true,
jsxImportSource: "@emotion/react",
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
// "@vitejs/plugin-react",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime",
"babel-plugin-macros",
"@emotion",
],
}),
],
});