-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters