-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.mix.js
67 lines (57 loc) · 3.2 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
const mix = require('laravel-mix');
const fs = require('fs');
const path = require('path');
const getFiles = directory => {
try {
return fs.readdirSync(directory).filter(
file => fs.statSync(path.resolve(directory, file)).isFile()
);
} catch (error) {
return [];
}
};
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel applications. By default, we are compiling the CSS
| file for the application as well as bundling up all the JS files.
|
*/
mix.sass('resources/scss/stisla/master.scss', 'public/css/stisla').sourceMaps();
mix.sass('resources/scss/stisla/style.scss', 'public/css/stisla');
mix.sass('resources/scss/stisla/components.scss', 'public/css/stisla');
mix.copy('node_modules/@fortawesome/fontawesome-free/webfonts', 'public/webfonts');
mix.combine([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/popper.js/dist/umd/popper.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/jquery.nicescroll/dist/jquery.nicescroll.min.js',
'node_modules/moment/min/moment-with-locales.min.js',
], 'public/js/stisla/master.js').sourceMaps();
mix.copy(`resources/js/stisla/app.js`, 'public/js/stisla');
mix.copy(`resources/js/stisla/scripts.js`, 'public/js/stisla');
getFiles('resources/js/helpers').forEach(filename => {
mix.copy(`resources/js/helpers/${filename}`, 'public/js/helpers');
});
[
// put the specified page js files here
'achievement',
'report',
].forEach(directory => {
getFiles(`resources/js/page/${directory}`).forEach(filename => {
mix.copy(`resources/js/page/${directory}/${filename}`, `public/js/page/${directory}`);
});
});
mix.combine('node_modules/select2/dist/css/select2.min.css', 'public/node_modules/select2/dist/css/select2.min.css');
mix.combine('node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css', 'public/node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css');
mix.combine('node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css', 'public/node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css');
mix.combine('node_modules/bootstrap-daterangepicker/daterangepicker.css', 'public/node_modules/bootstrap-daterangepicker/daterangepicker.css');
mix.combine('node_modules/select2/dist/js/select2.full.min.js', 'public/node_modules/select2/dist/js/select2.full.min.js');
mix.combine('node_modules/datatables/media/js/jquery.dataTables.min.js', 'public/node_modules/datatables/media/js/jquery.dataTables.min.js');
mix.combine('node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js', 'public/node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js');
mix.combine('node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js', 'public/node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js');
mix.combine('node_modules/datatables.net-plugins/i18n/id.json', 'public/node_modules/datatables.net-plugins/i18n/id.json');
mix.combine('node_modules/bootstrap-daterangepicker/daterangepicker.js', 'public/node_modules/bootstrap-daterangepicker/daterangepicker.js');