forked from Supertinypeanut/vue3-best-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
45 lines (43 loc) · 1.02 KB
/
vue.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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const lessVariable2js = require('./lessVariabel2js')
const variable = lessVariable2js('./src/assets/styles/variables.less')
module.exports = {
publicPath: process.env.VUE_APP_PROJECT_PATH,
css: {
loaderOptions: {
less: {
lessOptions: {
javascriptEnabled: true,
modifyVars: variable,
},
},
},
},
chainWebpack: config => {
config.plugin('html').tap(args => {
args[0].title = 'Project Name'
return args
})
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
path.resolve(__dirname, 'src/assets/styles/variables.less'),
path.resolve(__dirname, 'src/assets/styles/mixin.less'),
], // 引入全局样式变量
},
},
devServer: {
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_RUNTIME_HOST,
changeOrigin: true,
ws: true,
secure: false,
},
},
},
}