Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
65 lines (64 loc) · 1.58 KB
/
Copy pathvite.config.ts
File metadata and controls
65 lines (64 loc) · 1.58 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import react from "@vitejs/plugin-react";
import path from "path";
export default defineConfig({
plugins: [
react(),
nodePolyfills({
include: ["buffer", "stream", "util"],
globals: {
Buffer: true,
global: true,
process: true,
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
components: path.resolve(__dirname, "src/components"),
locales: path.resolve(__dirname, "src/locales"),
locals: path.resolve(__dirname, "src/locals"),
pages: path.resolve(__dirname, "src/pages"),
constants: path.resolve(__dirname, "src/constants"),
hooks: path.resolve(__dirname, "src/hooks"),
store: path.resolve(__dirname, "src/store"),
utils: path.resolve(__dirname, "src/utils"),
theme: path.resolve(__dirname, "src/theme"),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "@/globalStyles/variables.scss";`,
},
},
},
server: {
host: true,
port: 5173,
strictPort: true,
watch: {
usePolling: true,
},
},
preview: {
host: "0.0.0.0",
port: 4173,
strictPort: true,
},
build: {
outDir: "dist",
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
vendor: ["react", "react-dom", "react-router-dom"],
redux: ["@reduxjs/toolkit", "react-redux"],
mui: ["@mui/material", "@emotion/react", "@emotion/styled"],
},
},
},
},
});