-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
61 lines (57 loc) · 1.58 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const nodeExternals = require('webpack-node-externals');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
target: "node",
mode: "production",
entry: __dirname + '/src/index.ts',
externals: [nodeExternals()],
devtool: 'source-map',
module: {
rules: [
{
test: /\.ts(x?)$/,
loader: 'ts-loader',
exclude: [
/node_modules/,
/tests/,
/\.(spect|test)\.ts/
]
}
]
},
resolve: {
extensions: ['.ts', '.tsx','.webpack.js', '.web.js', '.js']
},
output: {
filename: 'index.js',
path: __dirname + '/build',
libraryTarget: 'umd',
library: 'tjom',
umdNamedDefine: true
},
optimization: {
minimize: false,
minimizer: [new UglifyJsPlugin({
extractComments: true,
parallel: true,
sourceMap: true,
include: /\.js$/,
uglifyOptions: {
comments: false,
warnings: false,
compress: true,
mangle: true,
toplevel: false,
ie8: false,
safari10: false,
keep_fnames: true,
keep_classnames: true
}
})]
},
plugins: [
new CleanWebpackPlugin(["./build"], {verbose: false})
]
};