forked from ng2-ui/map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
43 lines (39 loc) · 934 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
var path = require("path");
var webpack = require('webpack');
var config = {
entry: {
'ng2-map': path.join(__dirname, 'src', 'index.ts')
},
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.html']
},
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
output: {
path: path.join(__dirname, 'dist'),
filename: "[name].umd.js",
library: ["[name]"],
libraryTarget: "umd"
},
externals: [
/^rxjs\//, //.... any other way? rx.umd.min.js does work?
/^@angular\//
],
devtool: 'source-map',
module: {
loaders: [
{ // Support for .ts files.
test: /\.ts$/,
loaders: ['ts', 'angular2-template-loader']
}
]
}
};
//Different Environment Setup
if (process.env.NODE_ENV === 'prod') {
config.module.loaders.push({
test: /\.ts$/, loader: 'strip-loader?strip[]=debug,strip[]=console.log'
});
}
module.exports = config;