Guest User

Untitled

a guest
Apr 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. let mix = require('laravel-mix');
  2.  
  3. const antdRegex = /antd.+\.less$/;
  4. const theme = {
  5. 'primary-color': '#0097FF',
  6. };
  7.  
  8. // Exclude quill icons
  9. Mix.listen('configReady', function(config) {
  10. const rules = config.module.rules;
  11. const targetRe = /\.less$/;
  12.  
  13. for (let rule of rules) {
  14. if (rule.test.toString() == targetRe.toString()) {
  15. rule.exclude = antdRegex;
  16. break;
  17. }
  18. }
  19. });
  20.  
  21. mix.webpackConfig({
  22. module: {
  23. rules: [{
  24. test: antdRegex,
  25. loader: [
  26. 'style-loader',
  27. 'css-loader',
  28. {
  29. loader: 'less-loader',
  30. options: {
  31. modifyVars: theme,
  32. }
  33. }
  34. ],
  35. }]
  36. }
  37. });
Add Comment
Please, Sign In to add comment