Skip to content

Commit bb220b8

Browse files
committed
fix env flag usage
1 parent aaa3eb5 commit bb220b8

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

webpack.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,27 @@ More env flags that are usually passed by the CLI automatically:
4545
- `--env.platform=<platform>` - for specifying the platform to use. Can be `android` or `ios`, or a custom platform in the future.
4646
- `--env.hmr` - `true` if building with HMR enabled
4747

48-
#### Using flags at runtime
48+
<!-- #### Using flags at runtime -->
4949

50-
In your app logic you can access `env` variables like the following:
50+
<!-- In your app logic you can access `env` variables like the following: -->
5151

52-
```js
52+
<!-- ```js
5353
if (process.env.production) {
5454
// this is a build executed with the `--env.production` flag
5555
// typically this would be your release build
5656
} else {
5757
// this is a debug/dev build
5858
}
59+
``` -->
60+
61+
#### Using a .env file
62+
63+
You can add a `.env` file to your project root and add any values to it and access those at runtime.
64+
65+
```js
66+
if (process.env.VAR_NAME) {
67+
// do work here if the variable is true
68+
}
5969
```
6070

6171
::: tip Note
@@ -69,16 +79,6 @@ if (__DEV__) {
6979

7080
:::
7181

72-
#### Using a .env file
73-
74-
You can add a `.env` file to your project root and add any values to it and access those at runtime.
75-
76-
```js
77-
if (process.env.VAR_NAME) {
78-
// do work here if the variable is true
79-
}
80-
```
81-
8282
### CLI flags
8383

8484
When running a NativeScript app the following flags have an effect on the webpack config:

0 commit comments

Comments
 (0)