Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore v4 webpack extend mode behavior AND deprecate it #6104

Merged
merged 8 commits into from
Mar 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ Storybook 5.0 includes sweeping UI changes as well as changes to the addon API a

The API for custom webpack configuration has been simplifed in 5.0, but it's a breaking change.

- We've simplified "full-control mode"
- We've deprecated "extend mode"

We describe each change below and encourage you to refer to the [current custom webpack documentation](https://github.com/storybooks/storybook/blob/next/docs/src/pages/configurations/custom-webpack-config/index.md) for more information on custom webpack config.

### Simplified full control mode

Storybook's "full control mode" for webpack allows you to override the webpack config with a function that returns a configuration object.

In Storybook 5 there is a single signature for full-control mode that takes a parameters object with the fields `config` and `mode`:
Expand All @@ -67,7 +74,9 @@ module.exports = ({ config, mode }) => { config.module.rules.push(...); return c

In contrast, the 4.x configuration function accepted either two or three arguments (`(baseConfig, mode)`, or `(baseConfig, mode, defaultConfig)`). The `config` object in the 5.x signature is equivalent to 4.x's `defaultConfig`.

Please see the [current custom webpack documentation](https://github.com/storybooks/storybook/blob/next/docs/src/pages/configurations/custom-webpack-config/index.md) for more information on custom webpack config.
### Deprecated extend mode

Exporting an object from your custom webpack config puts storybook in "extend mode". This is still supported in 5.x but we've deprecated this and encourage users to use full-control mode instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a code snippet of how to achieve the exact same behaviour of extend mode with full control mode?


## Theming overhaul

Expand Down
Loading