-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.cjs
44 lines (43 loc) · 1.08 KB
/
webpack.config.cjs
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 path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: './src/server.ts',
output: {
libraryTarget: 'umd',
globalObject: 'this',
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
},
target: 'node',
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: [/node_modules/, /documentation/],
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/, /documentation/],
options: {
presets: ['@babel/preset-env'],
},
},
],
},
optimization: {
minimize: false,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_fnames: /AbortSignal/,
sourceMap: true,
},
}),
],
},
resolve: {
extensions: ['.ts', '.js'],
},
};