-
Notifications
You must be signed in to change notification settings - Fork 15
/
webpack.mix.js
42 lines (39 loc) · 1.74 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
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/materialize_custom.js', 'public/js/materialize.js') // We use our custom materialize JS
.js('resources/js/cookieconsent-initialize.js', 'public/js/')
.scripts(['resources/js/site.js'], 'public/js/site.js')
// We have to copy already minimized JS
.copy('resources/js/cookieconsent.min.js', 'public/js/') // TODO: see #223
.copy([
'node_modules/moment/min/moment.min.js',
'node_modules/jquery/dist/jquery.min.js',
'node_modules/tabulator-tables/dist/js/tabulator.min.js'
], 'public/js/')
// Compile SASS
.sass('resources/sass/materialize.scss', 'public/css/', {
additionalData: '$isDebug: ' + process.env.APP_DEBUG + ';'
})
// Add common styles here
.styles([
'resources/css/tabulator_materialize.min.css', // This might cause problems if it gets ouf of sync with the JS
'resources/css/cookieconsent.min.css',
'resources/css/fonts.css'
], 'public/css/app.css')
// Add page specific files one by one
.styles('resources/css/welcome_page.css', 'public/css/welcome_page.css')
.js('resources/js/page_based/localizations.js', 'public/js/page_based/localizations.js');
// For fonts downloaded from Google Fonts
mix.copyDirectory('resources/fonts', 'public/fonts');
if (mix.inProduction()) {
mix.version(); // For cache bumping
}