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.

45 lines
1.3 KiB

3 years ago
  1. const mix = require('laravel-mix')
  2. const SvgSpritemapPlugin = require('svg-spritemap-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 your application, as well as bundling up your JS files.
  11. |
  12. */
  13. mix.webpackConfig({
  14. plugins: [
  15. new SvgSpritemapPlugin('src/icons/*.svg', {
  16. output: {
  17. filename: 'dist/symbol-defs.svg',
  18. chunk: {
  19. keep: true
  20. },
  21. svgo: {
  22. plugins: [{
  23. removeAttrs: {
  24. attrs: 'fill'
  25. }
  26. }]
  27. },
  28. svg4everybody: false
  29. },
  30. sprite: {
  31. prefix: 'icon-'
  32. }
  33. })
  34. ]
  35. })
  36. mix
  37. .sass('src/scss/plain-ui.scss', 'dist/plain-ui.css')
  38. .copy('src/fonts/*', 'dist/fonts')
  39. .options({
  40. postCss: [
  41. require('postcss-css-variables')()
  42. ]
  43. })