-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
32 lines (30 loc) · 932 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
const config = {
productionSourceMap: true,
pages: {
tool: {
entry: 'src/tool.js',
template: 'public/tool.html',
},
setting: {
entry: 'src/setting.js',
template: 'public/setting.html',
}
},
chainWebpack: config => {
config.plugin('define').tap(args => {
args[0]['process.ctool'] = JSON.stringify({
version: process.env.npm_package_version,
updateTime: Date.parse((new Date()).toString())/1000,
});
return args
})
},
};
let fs = require('fs');
fs.readFile('./src/manifest.json', 'utf8', function (err, files) {
let result = files.replace(/##version##/g, process.env.npm_package_version);
fs.writeFile('./public/manifest.json', result, 'utf8', function (err) {
if (err) return console.log(err);
});
});
module.exports = config;