No Description

index.js 1.5KB

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