-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
35 lines (34 loc) · 1.01 KB
/
webpack.dev.js
File metadata and controls
35 lines (34 loc) · 1.01 KB
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
const path = require('path');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const ExtensionReloader = require('webpack-extension-reloader');
module.exports = (env, argv) => {
return merge(
common,
{
mode: 'development',
devtool: 'inline-source-map',
plugins: [
// watch モードのみ Hot Reload を有効化
// https://github.com/webpack/webpack/issues/6460#issuecomment-364252873
// https://github.com/webpack/webpack/issues/6460#issuecomment-386947990
(argv.watch || argv.w) ? (new ExtensionReloader({
port: 9090,
reloadPage: true,
manifest: path.resolve(__dirname, 'src', 'manifest.json'),
entries: {
contentScript: [
'content',
],
background: [
'background',
],
extensionPage: [
'options',
],
},
})) : false,
].filter(Boolean),
}
);
};