forked from polonel/trudesk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
127 lines (124 loc) · 5.54 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
//context: path.resolve(__dirname, 'public/js'),
target: 'web',
entry : {
vendor: ['jquery', 'jquery_custom', 'angular', 'angularRoute', 'angularCookies', 'angularSanitize', 'datatables', 'dt_responsive', 'dt_grouping', 'dt_ipaddress', 'modernizr', 'underscore'],
truRequire: 'expose-loader?truRequire!' + path.resolve(__dirname, './src/public/js/truRequire'),
'trudesk.min': path.resolve(__dirname, 'src/public/js/app.js')
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'public/js'),
publicPath: '/js/'
},
resolve: {
modules: [path.resolve(__dirname, 'src/public/js/')],
alias: {
//server side
roles: path.resolve(__dirname, 'src/permissions/roles'),
//client side
jquery: 'vendor/jquery/jquery',
jquery_scrollTo:'vendor/jquery/jquery.scrollTo.min',
jscookie: 'vendor/jscookie/js.cookie',
easing: 'vendor/jquery/jquery.easing',
angular: 'vendor/angular/angular.min',
angularRoute: 'vendor/angular/angular-route.min',
angularCookies: 'vendor/angular/angular-cookies.min',
angularSanitize:'vendor/angular/angular-sanitize.min',
moment: 'vendor/moment/moment',
moment_timezone:'vendor/moment/moment-timezone-with-data',
uikit: 'vendor/uikit/js/uikit_combined.min',
modernizr: 'vendor/modernizr/modernizr',
fastclick: 'vendor/fastclick/fastclick',
placeholder: 'vendor/placeholder/placeholder',
underscore: 'vendor/underscore/underscore',
history: 'vendor/history/jquery.history',
app: 'app',
async: 'vendor/async/async',
jquery_custom: 'plugins/jquery.custom',
datatables: 'vendor/datatables/jquery.dataTables',
dt_responsive: 'vendor/datatables/dataTables.responsive',
dt_grouping: 'vendor/datatables/dataTables.grouping',
dt_scroller: 'vendor/datatables/dataTables.scroller',
dt_ipaddress: 'vendor/datatables/dataTables.ipaddress',
easypiechart: 'vendor/easypiechart/easypiechart',
chosen: 'vendor/chosen/chosen.jquery.min',
autogrow: 'plugins/autogrow',
pace: 'vendor/pace/pace.min',
tomarkdown: 'vendor/tomarkdown/tomarkdown',
colorpicker: 'vendor/simplecolorpicker/jquery.simplecolorpicker',
datepicker: 'vendor/datepicker/foundation-datepicker',
d3: 'vendor/d3/d3.min',
c3: 'vendor/c3/c3',
metricsgraphics:'vendor/metricsgraphics/metricsgraphics.min',
d3pie: 'vendor/d3pie/d3pie.min',
peity: 'vendor/peity/jquery.peity.min',
countup: 'vendor/countup/countUp.min',
velocity: 'vendor/velocity/velocity.min',
selectize: 'vendor/selectize/selectize',
multiselect: 'vendor/multiselect/js/jquery.multi-select',
waves: 'vendor/waves/waves',
isinview: 'plugins/jquery.isinview',
jquery_docsize: 'plugins/jquery.documentsize',
idletimer: 'plugins/jquery.idletimer.js',
jquery_steps: 'plugins/jquery.steps',
jquery_actual: 'plugins/jquery.actual',
formvalidator: 'vendor/formvalidator/jquery.form-validator',
qrcode: 'vendor/qrcode/jquery.qrcode.min',
tether: 'vendor/tether/tether',
shepherd: 'vendor/shepherd/js/shepherd.min',
easymde: 'vendor/easymde/dist/easymde.min',
snackbar: 'plugins/snackbar'
}
},
externals: {
//These are bunbled already
jsdom: 'jsdom',
canvas: 'canvas'
},
module: {
rules: [
{ test: /angular\.min\.js/, use: 'exports-loader?angular' },
{ test: /uikit_combined\.min\.js/, use: 'exports-loader?UIkit' },
{ test: /\.sass$/, exclude: path.resolve(__dirname, 'node_modules'), use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [{loader: 'css-loader', options: {minimize: false}}, 'sass-loader'],
publicPath: '/public/css'
})}
]
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Cookies: 'jscookie',
Tether: 'tether',
'window.Tether': 'tether',
'window.jQuery': 'jquery',
'window.$': 'jquery',
Modernizr: 'modernizr',
'window.Modernizr': 'modernizr',
moment: 'moment',
'window.moment': 'moment',
setImmediate: 'async'
}),
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor'],
minChunks: Infinity
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin({
filename: '../css/app.min.css',
allChunks: true
})
],
performance: {
hints: 'warning',
maxEntrypointSize: 10000000,
maxAssetSize: 80000000
}
};