-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.config.js
51 lines (50 loc) · 1.36 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable @typescript-eslint/no-var-requires */
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
module.exports = {
entry: {
'autoscale-shared': './autoscale-shared/index.ts'
},
devtool: 'inline-source-map',
mode: 'production',
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {}
},
{
test: /\.node$/,
type: 'asset/resource',
generator: {
filename: 'static/[base]'
}
},
// https://github.com/webpack/webpack/issues/11467#issuecomment-691873586
{ test: () => /\.m?js/, resolve: { fullySpecified: false } }
]
},
resolve: {
extensions: ['.js', '.tsx', '.ts']
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
keep_fnames: /AbortSignal/
},
extractComments: false
})
]
},
output: {
filename: () => {
return './index.js';
},
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs'
},
target: 'node'
};