This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.dll.js
95 lines (83 loc) · 2.08 KB
/
webpack.dll.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
var webpack = require('webpack');
var path = require('path');
// Webpack Config
var webpackConfig = {
devtool: "#source-map",
entry: {
'angular2polyfills': [
'ie-shim',
'core-js/es6/symbol',
'core-js/es6/object',
'core-js/es6/function',
'core-js/es6/parse-int',
'core-js/es6/parse-float',
'core-js/es6/number',
'core-js/es6/math',
'core-js/es6/string',
'core-js/es6/date',
'core-js/es6/array',
'core-js/es6/regexp',
'core-js/es6/map',
'core-js/es6/set',
'core-js/es6/weak-map',
'core-js/es6/weak-set',
'core-js/es6/typed',
'core-js/es6/reflect',
// 'core-js/es6/promise', // problem with firefox
'core-js/es7/reflect',
'zone.js/dist/zone',
'zone.js/dist/long-stack-trace-zone',
],
'angular2vendor': [
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/core',
'@angular/common',
'@angular/forms',
'@angular/http',
'@angular/router',
]
},
output: {
path: './dist',
filename: 'dll.[name].[hash].bundle.js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js',
library: '__DLL_[name]',
},
plugins: [
new webpack.DllPlugin({
name: '[vendor]',
path: 'dist/vendor-manifest.json',
}),
new webpack.DllPlugin({
name: 'polyfills',
path: 'dist/polyfills-manifest.json',
}),
],
module: {
preLoaders: [
{
test: /\.js$/,
loader: 'source-map-loader',
exclude: [
// these packages have problems with their sourcemaps
path.resolve(__dirname, 'node_modules', 'rxjs'),
path.resolve(__dirname, 'node_modules', '@angular'),
path.resolve(__dirname, 'node_modules', '@ngrx'),
path.resolve(__dirname, 'node_modules', '@angular2-material'),
]
}
],
loaders: [
]
},
node: {
global: 'window',
crypto: 'empty',
module: false,
clearImmediate: false,
setImmediate: false
}
};
module.exports = webpackConfig;