-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.umd.js
60 lines (58 loc) · 1.47 KB
/
webpack.config.umd.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
const path = require('path');
// Webpack and its plugins
const CompressionPlugin = require('compression-webpack-plugin');
const ENV = process.env.NODE_ENV = 'production';
const metadata = {
env: ENV
};
module.exports = {
devtool: 'source-map',
entry: {
'main': './src/index.ts'
},
mode: 'production',
externals: {
'@angular/core': {
root: ['ng', 'core'],
commonjs: '@angular/core',
commonjs2: '@angular/core',
amd: '@angular/core'
},
'@angular/common': {
root: ['ng', 'common'],
commonjs: '@angular/common',
commonjs2: '@angular/common',
amd: '@angular/common'
},
'@angular/platform-browser': {
root: ['ng', 'platformBrowser'],
commonjs: '@angular/platform-browser',
commonjs2: '@angular/platform-browser',
amd: '@angular/platform-browser'
},
'rxjs/Subscription': {
root: ['rx', 'Subscription'],
commonjs: 'rxjs/Subscription',
commonjs2: 'rxjs/Subscription',
amd: 'rxjs/Subscription'
}
},
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader', query: { compilerOptions: { noEmit: false } } }
]
},
output: {
path: path.resolve(__dirname, 'dist/umd'),
filename: 'ngx-pubsub.js',
libraryTarget: 'umd',
library: 'ngx-pubsub'
},
plugins: [
new CompressionPlugin({test: /\.css$|\.html$|\.js$|\.map$/ })
],
resolve: {
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, 'node_modules')]
}
};