-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.mjs
41 lines (39 loc) · 911 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 legacy from '@vitejs/plugin-legacy'
import vue from '@vitejs/plugin-vue2'
import { defineConfig } from 'vite'
import { resolve } from 'path'
const transformHtmlPlugin = (data) => ({
name: 'transform-html',
transformIndexHtml: {
order: 'pre',
handler(html) {
return html.replace(/<%=\s*(\w+)\s*%>/gi, (match, p1) => data[p1] || '')
}
}
})
export default defineConfig({
plugins: [
vue(),
transformHtmlPlugin({
title: 'ProjectName',
description: 'A single page application created using Vue.js'
}),
legacy({
targets: ['ie >= 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime']
})
],
resolve: {
alias: {
'@': resolve(__dirname, '/src'),
'~bootstrap': 'bootstrap'
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "./src/scss/variables";`
}
}
}
})