-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
webpack.config.js
45 lines (44 loc) · 905 Bytes
/
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
const path = require('path');
const ShebangPlugin = require('webpack-shebang-plugin');
module.exports = {
mode: 'production',
entry: './index.ts',
target: 'node',
output: {
libraryTarget: 'commonjs2',
path: path.resolve(__dirname, 'build'),
filename: 'index.js'
},
optimization: {
minimize: true
},
resolve: {
extensions: ['.js', '.ts'],
fallback: {
fs: false,
tls: false,
net: false,
path: false,
zlib: false,
http: false,
https: false,
stream: false,
crypto: false
}
},
module: {
rules: [
{
test: /\.(js)/,
loader: 'babel-loader',
exclude: [path.resolve(__dirname, 'node_modules')]
},
{
test: /\.ts?$/,
loader: 'ts-loader',
exclude: [path.resolve(__dirname, 'node_modules')]
}
]
},
plugins: [new ShebangPlugin()]
};