Skip to content

Commit

Permalink
Core: Remove project root babel.config.js loading (#7573)
Browse files Browse the repository at this point in the history
Core: Remove project root `babel.config.js` loading
  • Loading branch information
shilman committed Jul 31, 2019
1 parent a73aa44 commit 8a3edb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Migration

- [From version 5.1.x to 5.1.10](#from-version-51x-to-5110)
- [babel.config.js support](#babelconfigjs-support)
- [From version 5.0.x to 5.1.x](#from-version-50x-to-51x)
- [React native server](#react-native-server)
- [Angular 7](#angular-7)
Expand Down Expand Up @@ -56,6 +58,12 @@
- [Packages renaming](#packages-renaming)
- [Deprecated embedded addons](#deprecated-embedded-addons)

## From version 5.1.x to 5.1.10

### babel.config.js support

SB 5.1.0 added [support for project root `babel.config.js` files](https://github.com/storybookjs/storybook/pull/6634), which was an [unintentional breaking change](https://github.com/storybookjs/storybook/issues/7058#issuecomment-515398228). 5.1.10 fixes this, but if you relied on project root `babel.config.js` support, this bugfix is a breaking change. The workaround is to copy the file into your `.storybook` config directory. We may add back project-level support in 6.0.

## From version 5.0.x to 5.1.x

### React native server
Expand Down
6 changes: 4 additions & 2 deletions lib/core/src/server/utils/load-custom-babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ function isBabelLoader8() {
}

export default async function(configDir, getDefaultConfig) {
const projectRoot = process.cwd();
// Between versions 5.1.0 - 5.1.9 this loaded babel.config.js from the project
// root, which was an unintentional breaking change. We can add back project support
// in 6.0.
const babelConfig =
loadFromPath(path.resolve(configDir, '.babelrc')) ||
loadFromPath(path.resolve(projectRoot, 'babel.config.js'));
loadFromPath(path.resolve(configDir, 'babel.config.js'));

if (babelConfig) {
// If the custom config uses babel's `extends` clause, then replace it with
Expand Down

0 comments on commit 8a3edb7

Please sign in to comment.