3
0

index.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-02-19 15:31:49
  4. * @LastEditTime: 2021-02-27 10:01:38
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: \intelligentLock\config\index.js
  8. */
  9. const config = {
  10. projectName: 'intelligentLock',
  11. date: '2021-2-19',
  12. designWidth: 750,
  13. deviceRatio: {
  14. 640: 2.34 / 2,
  15. 750: 1,
  16. 828: 1.81 / 2
  17. },
  18. sourceRoot: 'src',
  19. // outputRoot: 'dist',
  20. outputRoot: `dist/${process.env.TARO_ENV}`,
  21. plugins: [],
  22. defineConstants: {
  23. },
  24. copy: {
  25. patterns: [
  26. ],
  27. options: {
  28. }
  29. },
  30. framework: 'vue',
  31. mini: {
  32. postcss: {
  33. pxtransform: {
  34. enable: true,
  35. config: {
  36. }
  37. },
  38. url: {
  39. enable: true,
  40. config: {
  41. limit: 1024 // 设定转换尺寸上限
  42. }
  43. },
  44. cssModules: {
  45. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  46. config: {
  47. namingPattern: 'module', // 转换模式,取值为 global/module
  48. generateScopedName: '[name]__[local]___[hash:base64:5]'
  49. }
  50. }
  51. }
  52. },
  53. h5: {
  54. publicPath: '/',
  55. staticDirectory: 'static',
  56. // esnextModules: ['taro-ui'],
  57. esnextModules: ['taro-ui-vue'],
  58. postcss: {
  59. autoprefixer: {
  60. enable: true,
  61. config: {
  62. }
  63. },
  64. cssModules: {
  65. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  66. config: {
  67. namingPattern: 'module', // 转换模式,取值为 global/module
  68. generateScopedName: '[name]__[local]___[hash:base64:5]'
  69. }
  70. }
  71. }
  72. },
  73. weapp: {
  74. module: {
  75. postcss: {
  76. // css modules 功能开关与相关配置
  77. cssModules: {
  78. enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
  79. config: {
  80. namingPattern: 'module', // 转换模式,取值为 global/module,下文详细说明
  81. generateScopedName: '[name]__[local]___[hash:base64:5]'
  82. }
  83. }
  84. }
  85. }
  86. }
  87. }
  88. module.exports = function (merge) {
  89. if (process.env.NODE_ENV === 'development') {
  90. return merge({}, config, require('./dev'))
  91. }
  92. return merge({}, config, require('./prod'))
  93. }