Advertisement
Guest User

Untitled

a guest
Aug 14th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let mix = require('laravel-mix').mix;
  2. const WebpackShellPlugin = require('webpack-shell-plugin');
  3. const themeInfo = require('./theme.json');
  4.  
  5. var copyVendor = [
  6.     'slick-carousel',
  7.     'sweetalert2',
  8.     'magnific-popup',
  9.     'popper.js',
  10.     'lightbox2',
  11.     'gmap3'
  12. ]
  13.  
  14. /**
  15.  * Compile less
  16.  */
  17. mix.less('resources/less/main.less', 'assets/css/main.css')
  18.  
  19. /**
  20.  * Concat scripts
  21.  */
  22.  
  23. //  https://github.com/JeffreyWay/laravel-mix/blob/master/docs/concatenation-and-minification.md
  24. // mix.scripts([
  25. //   'node_modules/jquery/dist/jquery.min.js',
  26. //   'node_modules/bootstrap/dist/js/bootstrap.min.js',
  27. //   'node_modules/sweetalert2/dist/sweetalert2.min.js',
  28. //   'resources/js/scripts.js'
  29. // ], 'assets/js/all.js');
  30.  
  31.  
  32. mix.combine([
  33.         'node_modules/jquery/dist/jquery.min.js',
  34.         'node_modules/bootstrap/dist/js/bootstrap.min.js',
  35.         'node_modules/sweetalert2/dist/sweetalert2.min.js',
  36.         'resources/js/scripts.js'
  37.       ], 'assets/js/all.js');
  38.  
  39. /**
  40.  * Copy Font directory https://laravel.com/docs/5.4/mix#url-processing
  41.  */
  42. mix.copy(
  43.   'fonts',
  44.   '../../public/fonts'
  45. )
  46.  
  47. copyVendor.forEach(copyPackage);
  48.  
  49. /**
  50.  * Publishing the assets
  51.  */
  52. mix.webpackConfig({
  53.   plugins: [
  54.     new WebpackShellPlugin({onBuildExit:['php ../../artisan stylist:publish ' + themeInfo.name]})
  55.   ]
  56. });
  57.  
  58. function copyPackage(item, index) {
  59.     mix.copyDirectory([
  60.         'node_modules/' + item,
  61.     ], '../../public/themes/' + themeInfo.public + '/vendor/' + item, false);
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement