jcadima
6/13/2018 - 1:49 PM

Laravel Mix

https://github.com/JeffreyWay/laravel-mix/blob/master/docs/concatenation-and-minification.md
https://laracasts.com/discuss/channels/laravel/mix-combine-all-js-in-folder?page=1



// ============= CSS ==============
<link href="{{ asset('theme/assets/css/bootstrap.css') }}" rel="stylesheet" />
<link href="{{ asset('theme/assets/css/theme.css') }}" rel="stylesheet"/>
<link href="{{ asset('css/custom.css') }}" rel="stylesheet"/>


mix.combine([
'public/theme/assets/css/bootstrap.css',
'public/theme/assets/css/theme.css',
'public/css/custom.css'
], 'public/css/combined.css');

// ============ JS =================

<script src="{{ asset('theme/assets/js/jquery.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('theme/assets/js/bootstrap.js') }}" type="text/javascript"></script>
<script type="text/javascript" src="{{ asset('theme/assets/js/modernizr.js') }}"></script>
<script type="text/javascript" src="{{ asset('theme/assets/js/theme.js') }}"></script>

mix.combine([
    'public/theme/assets/js/jquery.min.js',
    'public/theme/assets/js/bootstrap.js',
    'public/theme/assets/js/modernizr.js',
    'public/theme/assets/js/theme.js'
    ], 'public/js/combined.js');