Skip to content

Commit 685384b

Browse files
authored
docs: replace BABEL_ENV with NODE_ENV (#1561)
According to the [babel documentation](https://babeljs.io/docs/en/options#envname), `NODE_ENV` can also be recognized when loading configurations, and `NODE_ENV` has better interoperability in the ecosystem. Here's a use case that `NODE_ENV` works well while `BABEL_ENV` might cause confusion: vuejs/vue-cli#5525 (comment)
1 parent 8fb9e94 commit 685384b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/guides/testing-single-file-components-with-karma.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ Install `karma-coverage`, `babel-plugin-istanbul`, and `cross-env`:
136136
npm install --save-dev karma-coverage cross-env
137137
```
138138

139-
We're going to use `cross-env` to set a `BABEL_ENV` environment variable. This way we can use `babel-plugin-istanbul` when we're compiling for our tests—we don't want to include `babel-plugin-istanbul` when we compile our production code:
139+
We're going to use `cross-env` to set a `NODE_ENV` environment variable. This way we can use `babel-plugin-istanbul` when we're compiling for our tests—we don't want to include `babel-plugin-istanbul` when we compile our production code:
140140

141141
```
142142
npm install --save-dev babel-plugin-istanbul
143143
```
144144

145-
Update your `.babelrc` file to use `babel-plugin-istanbul` when `BABEL_ENV` is set to test:
145+
Update your `.babelrc` file to use `babel-plugin-istanbul` when `NODE_ENV` is set to test:
146146

147147
```json
148148
{
@@ -174,13 +174,13 @@ module.exports = function(config) {
174174
}
175175
```
176176

177-
And update the `test` script to set the `BABEL_ENV`:
177+
And update the `test` script to set the `NODE_ENV`:
178178

179179
```json
180180
// package.json
181181
{
182182
"scripts": {
183-
"test": "cross-env BABEL_ENV=test karma start --single-run"
183+
"test": "cross-env NODE_ENV=test karma start --single-run"
184184
}
185185
}
186186
```

0 commit comments

Comments
 (0)