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