Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let mix = require('laravel-mix').mix;
- const WebpackShellPlugin = require('webpack-shell-plugin');
- const themeInfo = require('./theme.json');
- var copyVendor = [
- 'slick-carousel',
- 'sweetalert2',
- 'magnific-popup',
- 'popper.js',
- 'lightbox2',
- 'gmap3'
- ]
- /**
- * Compile less
- */
- mix.less('resources/less/main.less', 'assets/css/main.css')
- /**
- * Concat scripts
- */
- // https://github.com/JeffreyWay/laravel-mix/blob/master/docs/concatenation-and-minification.md
- // mix.scripts([
- // 'node_modules/jquery/dist/jquery.min.js',
- // 'node_modules/bootstrap/dist/js/bootstrap.min.js',
- // 'node_modules/sweetalert2/dist/sweetalert2.min.js',
- // 'resources/js/scripts.js'
- // ], 'assets/js/all.js');
- mix.combine([
- 'node_modules/jquery/dist/jquery.min.js',
- 'node_modules/bootstrap/dist/js/bootstrap.min.js',
- 'node_modules/sweetalert2/dist/sweetalert2.min.js',
- 'resources/js/scripts.js'
- ], 'assets/js/all.js');
- /**
- * Copy Font directory https://laravel.com/docs/5.4/mix#url-processing
- */
- mix.copy(
- 'fonts',
- '../../public/fonts'
- )
- copyVendor.forEach(copyPackage);
- /**
- * Publishing the assets
- */
- mix.webpackConfig({
- plugins: [
- new WebpackShellPlugin({onBuildExit:['php ../../artisan stylist:publish ' + themeInfo.name]})
- ]
- });
- function copyPackage(item, index) {
- mix.copyDirectory([
- 'node_modules/' + item,
- ], '../../public/themes/' + themeInfo.public + '/vendor/' + item, false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement