-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
48 lines (46 loc) · 1.18 KB
/
vite.config.js
File metadata and controls
48 lines (46 loc) · 1.18 KB
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
import react from '@vitejs/plugin-react-swc'
import { dirname, resolve } from 'path'
import preprocessorDirectives from 'unplugin-preprocessor-directives/vite'
import { fileURLToPath } from 'url'
import { defineConfig } from 'vite'
import jsconfigPaths from 'vite-jsconfig-paths'
import eslint from 'vite-plugin-eslint'
import stylelint from 'vite-plugin-stylelint'
import packageJson from './package.json'
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'~': resolve(dirname(fileURLToPath(import.meta.url)), 'src/style'),
},
},
plugins: [
react(),
jsconfigPaths(),
eslint(),
stylelint(),
preprocessorDirectives(),
],
server: {
port: 3000,
proxy: {
'/api': 'http://127.0.0.1:8000',
'/ws': {
target: 'http://127.0.0.1:8000',
ws: true,
},
},
},
build: {
rollupOptions: {
treeshake: 'smallest',
},
},
define: {
'import.meta.env.DAKARA_VERSION': JSON.stringify(packageJson.version),
'import.meta.env.DAKARA_BUGTRACKER': JSON.stringify(packageJson.bugs.url),
'import.meta.env.DAKARA_PROJECT_HOMEPAGE': JSON.stringify(
packageJson.homepage
),
},
})