-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
webpack.config.js
39 lines (36 loc) · 876 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
const { resolve } = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const extensionPath = resolve(__dirname, "PolyglotSafariExtension");
const isDevelopment = process.env.NODE_ENV !== "production";
module.exports = {
devtool: isDevelopment ? "eval-source-map" : undefined,
entry: "./PolyglotSafariExtension/Sources/content.ts",
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: "ts-loader",
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
output: {
filename: "content.bundle.js",
path: resolve(extensionPath, "ContentScript"),
},
optimization: {
minimize: !isDevelopment,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
drop_console: true,
},
},
}),
],
},
};