-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
37 lines (36 loc) · 939 Bytes
/
webpack.prod.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 { join } = require("path"),
webpack = require("webpack"),
TerserPlugin = require("terser-webpack-plugin")
module.exports = {
mode: "production",
context: join(__dirname, "src"),
entry: ["./index.tsx"],
plugins: [new webpack.HashedModuleIdsPlugin()],
output: {
path: join(__dirname, "public"),
filename: "[name].js",
chunkFilename: "[name].js"
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
module: {
rules: [
{
test: /\.js$/,
use: ["babel-loader"],
exclude: /node_modules/
},
{
test: /\.tsx?$/,
use: ["ts-loader"],
include: join(__dirname, "src"),
exclude: /node_modules/
}
]
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
}