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