-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
82 lines (74 loc) · 1.86 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
82
(function() {
'use strict';
var
path = require('path'),
dotenv = require('dotenv').config(),
debug = (process.env.NODE_ENV !== "production"),
webpack = require('webpack'),
BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
;
var
uglifyConfig = {
comments: false,
compress: { warnings: false }
},
buildConfig = {
caching: false,
context: __dirname,
devtool: null,
entry: {
app: "./dev/js/app.js",
vendors: [
'angular',
'angular-loading-bar',
'angular-animate',
'angular-ui-router',
'angular-cookies',
'angular-touch',
'angular-ui-router-default',
'ng-file-upload',
'ng-tags-input',
'angular-timeago',
'angular-bootstrap-colorpicker',
'angularjs-slider',
'angular-websocket',
'validator'
]
},
output: {
path: __dirname + "/public/js",
filename: "app.min.js"
},
resolve: {
alias: {}
},
module: {
noParse: [],
loaders: []
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery":"jquery",
_: "lodash",
validator: "validator",
masonry: "masonry-layout",
SimpleCryptoJS: "simple-crypto-js",
matrixTransform: "2d-css-matrix-parse",
moment: "moment",
webNotificationAPI: "simple-web-notification",
AOS: "aos"
}),
new webpack.optimize.CommonsChunkPlugin("vendors", "[name].bundle.js", Infinity)
// new BundleAnalyzerPlugin()
],
}
;
buildConfig.entry.vendors.push('bootstrap/dist/js/bootstrap.min');
buildConfig.entry.vendors.push('angular-ui-bootstrap/dist/ui-bootstrap-tpls');
if (!debug) buildConfig.plugins.push(new webpack.optimize.UglifyJsPlugin(uglifyConfig));
module.exports = buildConfig;
})();