-
Notifications
You must be signed in to change notification settings - Fork 4
/
vue.config.js
59 lines (54 loc) · 1.59 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const path = require('path')
module.exports = {
publicPath: '/music/',
outputDir: 'music',
assetsDir: './static',
// ...other vue-cli plugin options...
pwa: {
name: 'FreeMusic',
themeColor: '#4DBA87',
msTileColor: '#ffffff',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'white',
iconPaths: {
appleTouchIcon: 'public/img/icons/apple-touch-icon-152x152.png',
maskIcon: 'public/img/icons/safari-pinned-tab.svg',
msTileImage: 'public/img/icons/msapplication-icon-144x144.png'
},
// configure the workbox plugin
workboxPluginMode: 'InjectManifest',
workboxOptions: {
// swSrc is required in InjectManifest mode.
swSrc: 'src/registerServiceWorker.js'
// ...other Workbox options...
}
},
devServer: {
open: process.platform === 'darwin',
// host: '192.168.199.163',
port: 8082,
https: false,
hotOnly: false,
// proxy: {}, // 设置代理
before: app => { }
},
// 配置使用stylus全局变量
chainWebpack: config => {
const types = ["vue-modules", "vue", "normal-modules", "normal"];
types.forEach(type =>
addStyleResource(config.module.rule("stylus").oneOf(type))
);
}
}
// 定义函数addStyleResource
function addStyleResource(rule) {
rule.use("style-resource")
.loader("style-resources-loader")
.options({
patterns: [
path.resolve(__dirname, "./src/common/stylus/variable.styl"),
path.resolve(__dirname, "./src/common/stylus/mixin.styl"),
]
//后面的路径改成你自己放公共stylus变量的路径
});
}