-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
81 lines (65 loc) · 1.52 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
var webpack = require('webpack');
var path = require('path');
var ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
const ROOT = path.resolve(__dirname, 'src');
const DEST = path.resolve(__dirname, 'dist');
module.exports = {
entry: {
main: path.resolve(ROOT, 'angular-translate-loader-pluggable.ts')
},
output: {
path: DEST,
filename: 'angular-translate-loader-pluggable.min.js',
library: 'angular-translate-loader-pluggable',
libraryTarget: 'umd',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
exclude: [/node_modules/]
},
{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader'
},
{
test: /\.ts$/,
exclude: [/node_modules/],
loader: 'awesome-typescript-loader'
}
],
},
resolve: {
extensions: ['.ts', '.js'],
modules: [
ROOT,
'node_modules'
]
},
externals: {
angular: 'angular'
},
plugins: [
new webpack.LoaderOptionsPlugin({
debug: true
}),
new webpack.NoErrorsPlugin(),
new ngAnnotatePlugin({
add: true
}),
// ,
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
// Minify all javascript, switch loaders to minimizing mode
new webpack.optimize.UglifyJsPlugin( {
// compress: {
// warnings: false
// }
})
]
}