This website requires JavaScript.
Explore
Help
Sign In
terribleplan
/
next.js
Watch
1
Star
0
Fork
You've already forked next.js
0
mirror of
https://github.com/terribleplan/next.js.git
synced
2024-01-19 02:48:18 +00:00
Code
Issues
Releases
Wiki
Activity
7dbe837ae4
next.js
/
test
/
.babelrc
6 lines
40 B
Plaintext
Raw
Normal View
History
Unescape
Escape
Speed up tests (#4102)
2018-04-03 12:43:56 +00:00
{
"presets": [
Use preset-react's development option + enable modules transform in test env (#5081) ## Minor changes When `NODE_ENV=test` is used we'll now apply the `'auto'` configuration for modules transformation. Which causes Babel to check if the current environment needs to be transformed or not. In practice this means that the following `.babelrc` is not needed anymore: **OLD**: ```json { "env": { "development": { "presets": ["next/babel"] }, "production": { "presets": ["next/babel"] }, "test": { "presets": [["next/babel", { "preset-env": { "modules": "commonjs" } }]] } } } ``` **NEW**: ``` { "presets": ["next/babel"] } ``` ## Patches `@babel/preset-react` has a `development` option that automatically applies a development-time plugin we manually applied before (`@babel/plugin-transform-react-jsx-source`). It also adds another development-time plugin that is said to make debugging/errors clearer: `@babel/plugin-transform-react-jsx-self` which we didn't apply before. Overall this means we can take advantage of preset-react to provide these plugins.
2018-09-03 14:41:52 +00:00
"next/babel"
Speed up tests (#4102)
2018-04-03 12:43:56 +00:00
]
Use preset-react's development option + enable modules transform in test env (#5081) ## Minor changes When `NODE_ENV=test` is used we'll now apply the `'auto'` configuration for modules transformation. Which causes Babel to check if the current environment needs to be transformed or not. In practice this means that the following `.babelrc` is not needed anymore: **OLD**: ```json { "env": { "development": { "presets": ["next/babel"] }, "production": { "presets": ["next/babel"] }, "test": { "presets": [["next/babel", { "preset-env": { "modules": "commonjs" } }]] } } } ``` **NEW**: ``` { "presets": ["next/babel"] } ``` ## Patches `@babel/preset-react` has a `development` option that automatically applies a development-time plugin we manually applied before (`@babel/plugin-transform-react-jsx-source`). It also adds another development-time plugin that is said to make debugging/errors clearer: `@babel/plugin-transform-react-jsx-self` which we didn't apply before. Overall this means we can take advantage of preset-react to provide these plugins.
2018-09-03 14:41:52 +00:00
}
Reference in a new issue
Copy permalink