-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.js
45 lines (42 loc) · 1015 Bytes
/
vite.config.js
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
import { defineConfig } from 'vite';
import { createVuePlugin } from 'vite-plugin-vue2';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [createVuePlugin()],
base: './',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: (content, loaderContext) => {
const relativePath = path.relative(__dirname, loaderContext);
if (relativePath === 'src/assets/scss/_variables.scss') {
return content;
}
return `@import "@/assets/scss/variables.scss";\n${content}`;
},
},
},
},
server: {
open: '/install.html',
},
build: {
assetsDir: 'install/assets',
emptyOutDir: true,
rollupOptions: {
input: {
main: path.resolve(__dirname, 'install.html'),
},
output: {
sourcemap: false,
},
makeAbsoluteExternalsRelative: true,
},
},
});