-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
37 lines (36 loc) · 892 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
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
const SRC_DIR = path.join(__dirname, "src");
const DIST_DIR = path.join(__dirname, "dist");
module.exports = {
entry: {
background: path.join(SRC_DIR, "background-script.ts"),
viewer: path.join(SRC_DIR, "viewer.ts"),
},
output: {
path: DIST_DIR,
filename: "js/[name].js",
},
module: {
rules: [
{
test: /\.ts?$/,
use: "ts-loader",
},
],
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
devtool: "inline-source-map",
plugins: [
new CopyPlugin({
patterns: [
{ from: "src/viewer.html", to: "viewer.html" },
{ from: "src/viewer.css", to: "viewer.css" },
{ from: "assets", to: "assets" },
{ from: 'node_modules/webextension-polyfill/dist/browser-polyfill.js', to:"js"}
],
}),
],
};