-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
28 lines (27 loc) · 909 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
const HomepageDataMocker = require('./lib/HomepageDataMocker');
module.exports = {
devServer: {
open: true
},
pages: {
index: './src/packages/homepage/main.ts'
},
productionSourceMap: false,
chainWebpack: config => {
const pages = ['index'];
if (process.env.NODE_ENV === 'development') {
pages.forEach(pageName => {
config
.plugin('html-' + pageName)
.tap(htmlWebpackPluginOptionsArr => {
htmlWebpackPluginOptionsArr.forEach(options => {
options.meta = Object.assign(options.meta || {}, {
navigator: HomepageDataMocker()
});
});
return htmlWebpackPluginOptionsArr;
});
});
}
}
};