forked from snipe/snipe-it
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
225 lines (211 loc) · 6.98 KB
/
webpack.mix.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
const mix = require("laravel-mix");
// This generates a file called app.css, which we use
// later on to build all.css
mix
.options({
processCssUrls: false,
processFontUrls: true,
clearConsole: false,
})
.less("./node_modules/admin-lte/build/less/AdminLTE.less", "css/build")
.less("./resources/assets/less/app.less", "css/build")
.less("./resources/assets/less/overrides.less", "css/build")
.styles(
[
"./node_modules/bootstrap/dist/css/bootstrap.css",
"./node_modules/@fortawesome/fontawesome-free/css/all.css",
"./public/css/build/AdminLTE.css",
"./node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.standalone.css",
"./node_modules/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css",
"./node_modules/blueimp-file-upload/css/jquery.fileupload.css",
"./node_modules/blueimp-file-upload/css/jquery.fileupload-ui.css",
"./node_modules/ekko-lightbox/dist/ekko-lightbox.css",
"./node_modules/bootstrap-table/dist/bootstrap-table.css",
"./public/css/build/app.css",
"./node_modules/select2/dist/css/select2.css",
"./public/css/build/overrides.css",
],
"./public/css/dist/all.css"
)
.version();
/**
* Copy, minify and version signature-pad.css
*/
mix
.copy("./resources/assets/css/signature-pad.css", "./public/css/dist")
.minify("./public/css/dist/signature-pad.css");
/**
* Copy and version select2
*/
mix
.copy("./node_modules/select2/dist/js/i18n", "./public/js/select2/i18n")
/**
* Copy and version fontawesome
*/
mix
.copy("./node_modules/@fortawesome/fontawesome-free/webfonts", "./public/css/webfonts")
/**
* Copy BS tables js file
*/
mix
.copy( './node_modules/bootstrap-table/dist/bootstrap-table-locale-all.min.js', 'public/js/dist' )
// Combine main SnipeIT JS files
mix
.js(
[
"./resources/assets/js/snipeit.js", //this is the actual Snipe-IT JS - require()s bootstrap.js
"./resources/assets/js/snipeit_modals.js",
],
"./public/js/build/app.js" //because of compiling - this does not work very well :(
)
// Convert the skins to CSS
mix.less(
"./resources/assets/less/skins/skin-blue.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-red.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-contrast.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-green.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-green-dark.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-black.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-black-dark.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-red-dark.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-purple.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-purple-dark.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-yellow.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-yellow-dark.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-blue-dark.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-orange-dark.less",
"css/dist/skins",
);
mix.less(
"./resources/assets/less/skins/skin-orange.less",
"css/dist/skins",
);
/**
* Combine bootstrap table css
*/
mix
.combine(
[
"./node_modules/bootstrap-table/dist/bootstrap-table.css",
"./node_modules/bootstrap-table/dist/extensions/sticky-header/bootstrap-table-sticky-header.css",
"./resources/assets/css/dragtable.css",
],
"public/css/dist/bootstrap-table.css"
)
.version();
/**
* Combine JS
*/
mix.combine(
[
// lots of node_modules here - should this be subsumed by require()?
"./node_modules/jquery/dist/jquery.js",
"./node_modules/select2/dist/js/select2.full.min.js",
"./node_modules/admin-lte/dist/js/adminlte.min.js",
"./node_modules/tether/dist/js/tether.js",
"./node_modules/jquery-ui/dist/jquery-ui.js",
"./node_modules/jquery-slimscroll/jquery.slimscroll.js",
"./node_modules/jquery.iframe-transport/jquery.iframe-transport.js",
"./node_modules/blueimp-file-upload/js/jquery.fileupload.js",
"./node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js",
"./node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js",
"./node_modules/ekko-lightbox/dist/ekko-lightbox.js",
"./resources/assets/js/extensions/pGenerator.jquery.js",
"./node_modules/chart.js/dist/Chart.js",
"./resources/assets/js/signature_pad.js",
"./node_modules/jquery-validation/dist/jquery.validate.js",
"./node_modules/list.js/dist/list.js",
"./node_modules/clipboard/dist/clipboard.js",
],
"public/js/build/vendor.js" // this file seems OK!
);
/**
* Combine bootstrap table js
*/
mix
.combine(
[
"./resources/assets/js/dragtable.js",
'./node_modules/bootstrap-table/dist/bootstrap-table.js',
'./node_modules/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile.js',
'./node_modules/bootstrap-table/dist/extensions/export/bootstrap-table-export.js',
'./node_modules/bootstrap-table/dist/extensions/cookie/bootstrap-table-cookie.js',
'./node_modules/bootstrap-table/dist/extensions/sticky-header/bootstrap-table-sticky-header.js',
'./node_modules/bootstrap-table/dist/extensions/addrbar/bootstrap-table-addrbar.js',
'./resources/assets/js/extensions/jquery.base64.js',
'./node_modules/tableexport.jquery.plugin/tableExport.min.js',
'./node_modules/tableexport.jquery.plugin/libs/jsPDF/jspdf.umd.min.js',
'./resources/assets/js/FileSaver.min.js',
'./node_modules/xlsx/dist/xlsx.core.min.js',
'./node_modules/bootstrap-table/dist/extensions/sticky-header/bootstrap-table-sticky-header.js',
'./node_modules/bootstrap-table/dist/extensions/toolbar/bootstrap-table-toolbar.js'
],
'public/js/dist/bootstrap-table.js'
).version();
mix
.combine(
["./public/js/build/vendor.js", "./public/js/build/app.js"],
"./public/js/dist/all.js"
)
.version();
/**
* Copy, minify and version skins
*/
mix
.minify([
"./public/css/dist/skins/skin-green.css",
"./public/css/dist/skins/skin-green-dark.css",
"./public/css/dist/skins/skin-black.css",
"./public/css/dist/skins/skin-black-dark.css",
"./public/css/dist/skins/skin-blue.css",
"./public/css/dist/skins/skin-blue-dark.css",
"./public/css/dist/skins/skin-yellow.css",
"./public/css/dist/skins/skin-yellow-dark.css",
"./public/css/dist/skins/skin-red.css",
"./public/css/dist/skins/skin-red-dark.css",
"./public/css/dist/skins/skin-purple.css",
"./public/css/dist/skins/skin-purple-dark.css",
"./public/css/dist/skins/skin-orange.css",
"./public/css/dist/skins/skin-orange-dark.css",
"./public/css/dist/skins/skin-contrast.css",
])
.version();