-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.ts
57 lines (54 loc) · 1.31 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
48
49
50
51
52
53
54
55
56
57
import { CheckerPlugin } from 'awesome-typescript-loader'
import { IgnorePlugin } from 'webpack'
import TerserPlugin from 'terser-webpack-plugin'
import path from 'path'
import webpack from 'webpack'
export default {
entry: {
serverless_admin_index: {
import: './src/serverless_admin_index.ts',
filename: '[name]/index.js',
},
serverless_iterator_index: {
import: './src/serverless_iterator_index.ts',
filename: '[name]/index.js',
},
},
output: {
// coz of lambda fn API
libraryTarget: 'commonjs2',
path: path.join(__dirname, 'dist'),
publicPath: '/',
},
target: 'node',
node: {
// Need this when working with express, otherwise the build fails
__dirname: false, // if you don't put this is, __dirname
__filename: false, // and __filename return blank or /
},
optimization: {
// TODO: add minification
// minimize: false,
minimize: true,
minimizer: [new TerserPlugin()],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader',
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
plugins: [
new CheckerPlugin(),
// @ts-expect-error
new webpack.IgnorePlugin(/^pg-native$/),
new IgnorePlugin({
resourceRegExp: /^pg-native$/,
}),
],
}