craco.config.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*******覆盖create-react-app默认配置******/
  2. const path = require('path');
  3. const resolve = dir => path.resolve(__dirname,dir);
  4. const CracoLessPlugin = require('craco-less');
  5. module.exports = {
  6. webpack:{
  7. alias:{
  8. '@':resolve('src'),
  9. '@common':resolve('src/common'),
  10. '@components':resolve('src/components'),
  11. '@utils':resolve('src/utils'),
  12. '@image':resolve('src/images'),
  13. }
  14. },
  15. plugins: [
  16. {
  17. plugin: CracoLessPlugin,
  18. options: {
  19. lessLoaderOptions: {
  20. lessOptions: {
  21. modifyVars: {
  22. '@primary-color': '#1690FF',
  23. '@theme-bg-color':'#fff',
  24. '@link-color': '#1690FF', // 链接色
  25. '@success-color': '#52c41a', // 成功色
  26. '@warning-color': '#faad14', // 警告色
  27. '@error-color': '#f5222d', // 错误色
  28. '@font-size-base': '14px', // 主字号
  29. '@heading-color': '#1690FF', // 标题色
  30. '@text-color': '#333', // 主文本色
  31. '@text-color-secondary': '#666', // 次文本色
  32. '@disabled-color': 'rgba(0, 0, 0, 0.25)', // 失效色
  33. '@border-radius-base': '2px', // 组件/浮层圆角
  34. '@border-color-base': '#d9d9d9', // 边框色
  35. '@box-shadow-base':'0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),0 9px 28px 8px rgba(0, 0, 0, 0.05)',
  36. },
  37. javascriptEnabled: true,
  38. },
  39. },
  40. },
  41. },
  42. ],
  43. };