index.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. const appid_weapp = '__APPID__'
  2. const CIPluginOpt = {
  3. // 微信小程序
  4. weapp: {
  5. appid: appid_weapp,
  6. privateKeyPath: `./private/private.${appid_weapp}.key`
  7. },
  8. // 字节跳动小程序
  9. tt: {
  10. email: "func@fys1001.onexmail.com",
  11. password: "lihai1243434798"
  12. },
  13. }
  14. const config = {
  15. projectName: 'myApp',
  16. date: '2023-3-2',
  17. designWidth: 750,
  18. deviceRatio: {
  19. 640: 2.34 / 2,
  20. 750: 1,
  21. 828: 1.81 / 2
  22. },
  23. sourceRoot: 'src',
  24. outputRoot: `dist/${process.env.TARO_ENV}`,
  25. plugins:[],
  26. defineConstants: {
  27. },
  28. copy: {
  29. patterns: [
  30. {
  31. from: 'src/native-pages',
  32. to: 'dist/native-pages'
  33. }
  34. ],
  35. options: {
  36. }
  37. },
  38. framework: 'react',
  39. compiler: 'webpack5',
  40. cache: {
  41. enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
  42. },
  43. mini: {
  44. postcss: {
  45. pxtransform: {
  46. enable: true,
  47. config: {
  48. selectorBlackList: [/van-/],
  49. }
  50. },
  51. url: {
  52. enable: true,
  53. config: {
  54. limit: 1024 // 设定转换尺寸上限
  55. }
  56. },
  57. cssModules: {
  58. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  59. config: {
  60. namingPattern: 'module', // 转换模式,取值为 global/module
  61. generateScopedName: '[name]__[local]___[hash:base64:5]'
  62. }
  63. }
  64. }
  65. },
  66. h5: {
  67. publicPath: '/',
  68. staticDirectory: 'static',
  69. esnextModules: ['taro-ui'],
  70. postcss: {
  71. autoprefixer: {
  72. enable: true,
  73. config: {
  74. }
  75. },
  76. cssModules: {
  77. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  78. config: {
  79. namingPattern: 'module', // 转换模式,取值为 global/module
  80. generateScopedName: '[name]__[local]___[hash:base64:5]'
  81. }
  82. }
  83. }
  84. },
  85. rn: {
  86. appName: 'taroDemo',
  87. postcss: {
  88. cssModules: {
  89. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  90. }
  91. }
  92. }
  93. }
  94. module.exports = function (merge) {
  95. if (process.env.NODE_ENV === 'development') {
  96. return merge({}, config, require('./dev'))
  97. }
  98. return merge({}, config, require('./prod'))
  99. }