Niki
1
Enonic version: 7.12.2
OS: Linnux
Dear Enonic Team,
Can you please tell me how to detect inside react4xp.gradle if enonic is runnig with dev mode?
For instance, there is startParameter.isContinuous()
that allows us to detect if enonic is runnig with “-c” flag
I need to set NODE_ENV equal to “development” or “production” depend on -dev flag
Cwe
2
Compile mode and runtime mode are two different things.
The NODE_ENV in your example is about compile environment, not runtime environment.
I don’t know if there is a way to detect if XP is running in DEV mode, perhaps via some REST API.
Cwe
3
Cwe
4
You can run a dev build in prod mode, and a prod build in dev mode.
This might help:
1 Like
Cwe
5
$ enonic system i
? Authentication token (<user>:<password>): *****************************
Loading...{
"Version": "7.13.0-SNAPSHOT",
"Installation": "demo",
"RunMode": "PROD",
"Build": {
"Hash": "ce361f6e44f1a191682138363c5ab9546fc62a18",
"ShortHash": "ce361f6",
"Branch": "master",
"Timestamp": "2023-03-13T06:02:37Z"
}
}
Cwe
6
(enonic system i -a user:password|grep RunMode|grep DEV) 2>/dev/null;echo $?
Niki
7
Thanks for your answer and advices Christian.
I’ll look into it.
1 Like