-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
vite.config.ts
42 lines (41 loc) · 1011 Bytes
/
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
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { viteSingleFile } from "vite-plugin-singlefile";
import svg from "vite-svg-loader";
export default defineConfig({
plugins: [
vue(),
svg({ svgo: false }),
viteSingleFile({ removeViteModuleLoader: true, deleteInlinedFiles: true }),
],
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
additionalData: `
@use "@/assets/_util.scss" as *;
@use "@/assets/_palette.scss" as *;
`,
},
},
},
server: {
proxy: {
"/cdn": {
target: "https://cdn.alt-mp.com",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/cdn/, ""),
secure: false,
},
},
},
resolve: {
alias: {
// https://github.com/vuejs/router/issues/858#issuecomment-823961788
// This line is necessary to work with vue-router
vue: "vue/dist/vue.esm-bundler.js",
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});