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