index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* eslint-disable import/no-commonjs */
  2. const path = require('path')
  3. const config = {
  4. projectName: 'agent-auth-react',
  5. date: '2021-1-27',
  6. designWidth: 750,
  7. deviceRatio: {
  8. 640: 2.34 / 2,
  9. 750: 1,
  10. 828: 1.81 / 2
  11. },
  12. sourceRoot: 'src',
  13. outputRoot: 'dist',
  14. alias: {
  15. '@': path.resolve(__dirname,'..','src')
  16. },
  17. plugins: [],
  18. defineConstants: {
  19. },
  20. copy: {
  21. patterns: [
  22. ],
  23. options: {
  24. }
  25. },
  26. framework: 'react',
  27. mini: {
  28. postcss: {
  29. pxtransform: {
  30. enable: true,
  31. config: {
  32. }
  33. },
  34. url: {
  35. enable: true,
  36. config: {
  37. limit: 1024 // 设定转换尺寸上限
  38. }
  39. },
  40. cssModules: {
  41. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  42. config: {
  43. namingPattern: 'module', // 转换模式,取值为 global/module
  44. generateScopedName: '[name]__[local]___[hash:base64:5]'
  45. }
  46. }
  47. }
  48. },
  49. h5: {
  50. publicPath: '/',
  51. staticDirectory: 'static',
  52. postcss: {
  53. autoprefixer: {
  54. enable: true,
  55. config: {
  56. }
  57. },
  58. cssModules: {
  59. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  60. config: {
  61. namingPattern: 'module', // 转换模式,取值为 global/module
  62. generateScopedName: '[name]__[local]___[hash:base64:5]'
  63. }
  64. }
  65. }
  66. }
  67. }
  68. export default function (merge) {
  69. if (process.env.NODE_ENV === 'development') {
  70. return merge({}, config, require('./dev'))
  71. }
  72. return merge({}, config, require('./prod'))
  73. }