-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
51 lines (49 loc) · 1.12 KB
/
webpack.config.js
File metadata and controls
51 lines (49 loc) · 1.12 KB
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
const webpack = require('webpack');
const path = require('path');
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
index: './src/index.ts',
polyfills: './src/polyfills.ts',
vendor: './src/vendor.ts'
},
output: {
path: path.resolve(__dirname, 'bundle'),
library: ['rx-webrpc', '[name]'],
libraryTarget: 'umd',
filename: '[name].js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].[chunkhash].chunk.js'
},
externals: [
'rxjs',
'grpc-web-client',
'google-protobuf',
'core-js'
],
devtool: 'source-map',
module: {
rules: [
{
test: /\.ts$/,
loader: 'awesome-typescript-loader'
}
]
},
resolve: {
extensions: [".ts", ".js"]
},
plugins: [
new UglifyJsPlugin({
beautify: false,
mangle: { screw_ie8: true, keep_fnames: true },
compress: { screw_ie8: true },
comments: false
}),
new CopyWebpackPlugin([
{ from: 'package.json', to: '' },
{ from: 'README.md', to: ''}
])
]
};