-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvite.config.mjs
More file actions
34 lines (30 loc) · 849 Bytes
/
vite.config.mjs
File metadata and controls
34 lines (30 loc) · 849 Bytes
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
import { fileURLToPath, URL } from 'node:url'
// import replace from "@rollup/plugin-replace";
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import {ViteEjsPlugin} from "vite-plugin-ejs";
import svgLoader from 'vite-svg-loader'
// https://vitejs.dev/config/
export default ({mode}) => {
process.env = {...process.env, ...loadEnv(mode, process.cwd())};
return defineConfig({
publicPath: "./",
outputDir: "dist",
assetsDir: "static",
plugins: [
vue(),
ViteEjsPlugin({
VITE_APP_TIER: process.env.VITE_APP_TIER
}),
svgLoader({
svgo: false
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
}
},
base: `/${process.env.VITE_APP_ASSET_URL}/${process.env.VITE_APP_TITLE}/`
});
}