1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/build/webpack/loaders
Tim Neutkens b97fc82aa1
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 16:41:52 +02:00
..
emit-file-loader.js [BUG] Fix emit-file-loader compatibility with Webpack 4 (#4918) 2018-08-07 13:49:30 -07:00
hot-self-accept-loader.js Move plugins and loaders to webpack folder (#4618) 2018-06-16 19:23:02 +02:00
next-babel-loader.js Use preset-react's development option + enable modules transform in test env (#5081) 2018-09-03 16:41:52 +02:00