-
Notifications
You must be signed in to change notification settings - Fork 15
/
webpack.watch.js
45 lines (42 loc) · 1.24 KB
/
webpack.watch.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
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const WebpackExtensionManifestPlugin = require('webpack-extension-manifest-plugin');
const moment = require('moment');
const packageName = "Lighthouse Development Preview"
const now = new moment();
const versionString = now.format('YYYY.MM.DD.HHmm')
const versionStringShort = now.utcOffset("+10:00").format('YYYY.MM.DD')
// get git info from command line
let commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
.trim();
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
static: './dist',
},
plugins: [
new WebpackExtensionManifestPlugin({
config: {
base: './static/manifest.json',
extend: {
version: versionString,
version_name: `${versionStringShort} build ${commitHash}`,
name: packageName,
short_name: packageName,
action : {
default_icon : {
16 : "icons/lighthouse64_dev.png"
}
},
icons: {
128: "icons/lighthouse128_dev.png",
64: "icons/lighthouse64_dev.png"
},
},
},
}),
]
});