index.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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:['@tarojs/plugin-platform-kwai'],
  26. defineConstants: {
  27. },
  28. copy: {
  29. patterns: [
  30. ],
  31. options: {
  32. }
  33. },
  34. framework: 'react',
  35. compiler: 'webpack5',
  36. cache: {
  37. enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
  38. },
  39. mini: {
  40. postcss: {
  41. pxtransform: {
  42. enable: true,
  43. config: {
  44. selectorBlackList: [/van-/],
  45. }
  46. },
  47. url: {
  48. enable: true,
  49. config: {
  50. limit: 1024 // 设定转换尺寸上限
  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. h5: {
  63. publicPath: '/',
  64. staticDirectory: 'static',
  65. esnextModules: ['taro-ui'],
  66. postcss: {
  67. autoprefixer: {
  68. enable: true,
  69. config: {
  70. }
  71. },
  72. cssModules: {
  73. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  74. config: {
  75. namingPattern: 'module', // 转换模式,取值为 global/module
  76. generateScopedName: '[name]__[local]___[hash:base64:5]'
  77. }
  78. }
  79. }
  80. },
  81. rn: {
  82. appName: 'taroDemo',
  83. postcss: {
  84. cssModules: {
  85. enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
  86. }
  87. }
  88. }
  89. }
  90. module.exports = function (merge) {
  91. if (process.env.NODE_ENV === 'development') {
  92. return merge({}, config, require('./dev'))
  93. }
  94. return merge({}, config, require('./prod'))
  95. }