-
Notifications
You must be signed in to change notification settings - Fork 14
/
vue.config.js
41 lines (39 loc) · 980 Bytes
/
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
const WorkboxPlugin = require("workbox-webpack-plugin")
const isProd = process.env.NODE_ENV === 'production'
module.exports = {
outputDir: 'music',
configureWebpack: {
devServer: {
open: true,
port: 8998,
},
externals: isProd ? {
vue: 'Vue',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
} : {},
plugins: [
new WorkboxPlugin.GenerateSW()
]
},
css: {
loaderOptions: {
postcss: {
plugins: [
require('postcss-pxtorem')({ // 把px单位换算成rem单位
rootValue: 14, // 换算的基数(设计图750的根字体为75)
// selectorBlackList: ['weui', 'mu'], // 忽略转换正则匹配项
propList: ['*']
})
]
},
sass: {
prependData: `
@import "@/style/variables.scss";
@import "@/style/mixin.scss";
`
},
},
},
};