-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvite.config.ts
46 lines (43 loc) · 1.08 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
/* eslint-disable import/no-extraneous-dependencies */
import react from "@vitejs/plugin-react"
import path from "path"
import eslint from "vite-plugin-eslint"
import mkcert from "vite-plugin-mkcert"
import svgr from "vite-plugin-svgr"
import tsconfigPaths from "vite-tsconfig-paths"
import { defineConfig, loadEnv } from "vite"
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }
return defineConfig({
build: {
outDir: path.resolve(__dirname, "dist"),
rollupOptions: {
input: path.resolve(__dirname, "index.html"),
},
},
assetsInclude: ["**/*.svg", "**/*.png", "**/*.wav"],
plugins: [
svgr({
svgrOptions: {
ref: true
}
}),
eslint({
failOnWarning: false,
failOnError: false
}),
react({
include: "**/*.{jsx,tsx}"
}),
tsconfigPaths(),
mkcert() // if testing against a http localhost backend, remove
],
server: {
port: 3000,
host: true,
hmr: {
overlay: false
}
}
})
}