-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (42 loc) · 992 Bytes
/
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 ExtensionReloader = require("webpack-extension-reloader");
const mode = process.env.NODE_ENV;
module.exports = {
mode,
devtool: "inline-source-map",
entry: {
background: './src/background.js'
},
output: {
publicPath: ".",
path: resolve(__dirname, "dist/"),
filename: "[name].js"
},
plugins: [
new ExtensionReloader({
port: 9123,
reloadPage: true,
manifest: resolve(__dirname, "./src/manifest.json")
}),
new CopyWebpackPlugin([
{ from: "./src/manifest.json" },
{ context: './src/', from: "*.css", to:'./' },
{ from: "./src/icons", to:'icons/' }
])
],
module: {
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: [require("@babel/preset-env")]
}
}
}
]
}
}