-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mjs
41 lines (38 loc) · 932 Bytes
/
vite.config.mjs
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
import { defineConfig, loadEnv } from "vite"
import vue from "@vitejs/plugin-vue"
import { fileURLToPath } from "url"
import path from "path"
import autoprefixer from "autoprefixer"
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "")
return {
plugins: [vue()],
base: env.VITE_HOST_ADDRESS,
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `
@use "@/assets/style-variables.scss" as *;
$font-path: "${env.VITE_FONT_PATH}";
`,
},
},
},
define: {
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
},
postcss: {
plugins: [autoprefixer()],
},
server: {
port: 3000,
},
}
})