-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
47 lines (44 loc) · 1.2 KB
/
webpack.config.ts
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
45
46
47
import TerserPlugin from "terser-webpack-plugin";
import type { Configuration } from "webpack";
const config: Configuration = {
entry: "./src/lib.ts",
output: {
clean: true,
filename: "date-differencer.min.js",
library: "DateDifferencer",
libraryTarget: "umd",
},
plugins: [],
module: {
rules: [
{
test: /\.ts$/iu,
use: [
{
loader: "babel-loader",
options: { presets: ["@babel/preset-env", "@babel/preset-typescript"] },
},
],
},
{
test: /\.js$/iu,
use: [
{
loader: "babel-loader",
options: { presets: ["@babel/preset-env"] },
},
],
},
],
},
resolve: { extensionAlias: { ".js": [".ts", ".js"] } },
optimization: {
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: { format: { comments: false } },
}),
],
},
};
export default config;