You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

4 years ago
  1. const mix = require('laravel-mix');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin')
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Mix Asset Management
  6. |--------------------------------------------------------------------------
  7. |
  8. | Mix provides a clean, fluent API for defining some Webpack build steps
  9. | for your Laravel application. By default, we are compiling the Sass
  10. | file for the application as well as bundling up all the JS files.
  11. |
  12. */
  13. mix.options({
  14. terser: {
  15. extractComments: false
  16. }
  17. })
  18. mix.webpackConfig({
  19. plugins: [
  20. new HtmlWebpackPlugin({
  21. filename: 'dist/index.html',
  22. template: 'src/html/index.html.ejs',
  23. inject: false,
  24. title: 'Lessons Learned / Start',
  25. content: '<a href="page-1.html">Page 1</a>',
  26. }),
  27. new HtmlWebpackPlugin({
  28. filename: 'dist/page-1.html',
  29. template: 'src/html/index.html.ejs',
  30. inject: false,
  31. title: 'Lessons Learned / Page 1',
  32. content: '<a href="page-2.html">Page 2</a>',
  33. }),
  34. new HtmlWebpackPlugin({
  35. filename: 'dist/page-2.html',
  36. template: 'src/html/index.html.ejs',
  37. inject: false,
  38. title: 'Lessons Learned / 2',
  39. content: '<a href="index.html">Start</a>',
  40. })
  41. ]
  42. })
  43. mix
  44. .js('src/js/index.js', 'dist/js')
  45. .sass('src/scss/styles.scss', 'dist/css');