forked from fauzanfebrian/whatsapp-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
37 lines (36 loc) · 1.01 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
const path = require('path')
const nodeExternal = require('webpack-node-externals')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = {
entry: './src/index.ts',
mode: 'production',
target: 'node',
output: {
path: path.resolve(__dirname, 'dist'), //set output dir to /build
filename: 'index.js', //name of build app
},
resolve: {
modules: [path.resolve(__dirname), 'node_modules'],
extensions: ['.ts', '.js', '.json'],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
loader: 'ts-loader',
},
],
},
externals: [nodeExternal()],
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
// keep the function/class name (typeorm need this)
keep_fnames: true,
},
}),
],
},
}