-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.dev.js
38 lines (37 loc) · 1.29 KB
/
webpack.dev.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
const path = require('path');
const webpack = require('webpack');
const WebpackShellPlugin = require('webpack-shell-plugin');
const ChromeExtensionReloader = require('webpack-chrome-extension-reloader')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const options = merge(common, {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
}),
new HtmlWebpackPlugin({
title: 'Popup',
template: './popup/index.html',
inject: true,
chunks:['popup'],
filename: 'popup.html'
}),
new WebpackShellPlugin({
onBuildEnd: ['node scripts/remove-evals.js']
}),
new webpack.HotModuleReplacementPlugin(),
new ChromeExtensionReloader({
port: 9090, // Which port use to create the server
reloadPage: true, // Force the reload of the page also
entries: {
background: 'background',
popup: 'popup',
contentScripts:'contentScripts/index'
}
})
]
});
module.exports = options;