-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
44 lines (41 loc) · 1.13 KB
/
webpack.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
33
34
35
36
37
38
39
40
41
42
43
44
const { resolve } = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtensionReloaderPlugin = require("../webpack-extension-reloader");
const mode = process.env.NODE_ENV;
module.exports = {
mode,
devtool: "inline-source-map",
entry: {
"content-script": "./src/content-script.js",
"background": "./src/background.js"
},
output: {
publicPath: ".",
path: resolve(__dirname, "dist/"),
filename: "[name].bundle.js",
libraryTarget: "umd",
},
plugins: [
/***********************************************************************/
/* By default the plugin will work only when NODE_ENV is "development" */
/***********************************************************************/
new ExtensionReloaderPlugin({
entries: {
contentScript: "content-script",
background: "background",
// extensionPage: "popup",
},
// Also possible to use
// manifest: resolve(__dirname, "manifest.json")
}),
new CopyWebpackPlugin({
patterns: [
{ from: 'manifest.json'},
],
}),
],
module: {
rules: [
],
},
};