-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.common.js
44 lines (43 loc) · 1.05 KB
/
webpack.common.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
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
module.exports = {
entry: './src/index.tsx',
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
},
],
},
output: {
path: path.resolve(__dirname, 'dist/'),
filename: 'bundle.js',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
fallback: {
fs: false,
net: false,
tls: false,
assert: require.resolve('assert/'),
https: require.resolve('https-browserify'),
crypto: require.resolve('crypto-browserify'),
buffer: require.resolve('buffer/'),
http: require.resolve('stream-http'),
stream: require.resolve('stream-browserify'),
os: require.resolve('os-browserify/browser'),
zlib: require.resolve('browserify-zlib'),
path: require.resolve('path-browserify'),
},
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
},
};