-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.ts
41 lines (33 loc) · 895 Bytes
/
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
// eslint-disable-next-line node/no-unpublished-import
import nodeExternals from 'webpack-node-externals';
// eslint-disable-next-line node/no-unpublished-import
import TerserPlugin from 'terser-webpack-plugin';
// eslint-disable-next-line node/no-unpublished-import
import Dotenv from 'dotenv-webpack';
import { resolve } from 'path';
module.exports = {
entry: './src/index.ts',
mode: process.env.NODE_ENV || 'development',
externalsPresets: { node: true },
externals: [nodeExternals()],
output: {
filename: 'index.js',
path: resolve(__dirname, 'build'),
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts?$/,
use: ['babel-loader'],
exclude: /node_modules/,
},
],
},
plugins: [new Dotenv()],
optimization: {
minimizer: [new TerserPlugin({ extractComments: false })],
},
};