| | |
| | | module.exports = function (merge) { |
| | | if (isCI) { |
| | | if (API_ENV === "development") { |
| | | // CI 上传/预览(体验版)即使指向预发环境,也必须使用 production 版 React 打包。 |
| | | // dev.js 里 env.NODE_ENV 固定为 "development",会让 webpack 打入 development 版 React, |
| | | // 而 development React 依赖仅存在于开发构建的内部变量(如 app.mount、 |
| | | // ReactCurrentActQueue.isBatchingLegacy),上传为体验版/预览版在真机或微信后台运行时会报 |
| | | // "null/undefined is not an object" 而崩溃(本地开发者工具用 production 构建所以正常)。 |
| | | // 这里保留 dev.js 的预发 API 域名等 defineConstants,仅把 NODE_ENV 覆盖回 production。 |
| | | return merge({}, config, require("./dev"), { env: { NODE_ENV: '"production"' } }); |
| | | |
| | | return merge({}, config, require("./dev")); |
| | | } |
| | | } |
| | | |