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.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. const mix = require('laravel-mix')
  2. const SvgSpritemapPlugin = require('svg-spritemap-webpack-plugin')
  3. const path = require('path')
  4. require('laravel-mix-purgecss')
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Mix Asset Management
  8. |--------------------------------------------------------------------------
  9. |
  10. | Mix provides a clean, fluent API for defining some Webpack build steps
  11. | for your Laravel application. By default, we are compiling the Sass
  12. | file for your application, as well as bundling up your JS files.
  13. |
  14. */
  15. mix.webpackConfig({
  16. plugins: [
  17. new SvgSpritemapPlugin('src/icons/svg/*.svg', {
  18. output: {
  19. filename: 'symbol-defs.svg',
  20. chunk: {
  21. keep: true
  22. },
  23. svgo: {
  24. plugins: [{
  25. removeAttrs: {
  26. attrs: 'fill'
  27. }
  28. }]
  29. },
  30. svg4everybody: false
  31. },
  32. sprite: {
  33. prefix: 'icon-'
  34. }
  35. })
  36. ]
  37. })
  38. mix
  39. .setPublicPath('./public')
  40. .sass('src/scss/plain-ui.scss', 'public/plain-ui.css')
  41. .purgeCss({
  42. extend: {
  43. content: [
  44. path.join(__dirname, 'public/*.html'),
  45. ]
  46. }
  47. })