diff --git a/lib/isDev.ts b/lib/isDev.ts index 425ed89..a4dc2ff 100644 --- a/lib/isDev.ts +++ b/lib/isDev.ts @@ -1,8 +1,18 @@ -let isDev = true; const env = (process as any).env; -if ((env.PACKAGE && env.PACKAGE === 'production') || (env.REACT_APP_PACKAGE && env.REACT_APP_PACKAGE !== 'dev')) { - isDev = false; +const isDev = () => { + // 旧版本脚手架 + if (env.PACKAGE === 'production') { + return false; + } + + // 新版本(旧版的PACKAGE变量所有环境都会存在,所以只要没有PACKAGE,就认为是新版本) + if (!env.PACKAGE && env.REACT_APP_PACKAGE !== 'dev') { + return false; + } + + return true; } -export default isDev; + +export default isDev(); diff --git a/package.json b/package.json index 6758a38..746db18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "auto-libs", - "version": "0.1.18", + "version": "0.1.19", "description": "凹凸 公用组件", "main": "build/index", "types": "build/index",