-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM although I can't speak to the exact webpack config :)
MIGRATION.md
Outdated
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. |
There was a problem hiding this comment.
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?
Codecov Report
@@ Coverage Diff @@
## next #6104 +/- ##
=========================================
- Coverage 37.1% 37.09% -0.02%
=========================================
Files 648 649 +1
Lines 9524 9528 +4
Branches 1381 1352 -29
=========================================
Hits 3534 3534
- Misses 5411 5415 +4
Partials 579 579
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## next #6104 +/- ##
=========================================
- Coverage 37.1% 37.09% -0.02%
=========================================
Files 648 648
Lines 9524 9528 +4
Branches 1381 1381
=========================================
Hits 3534 3534
- Misses 5411 5415 +4
Partials 579 579
Continue to review full report at Codecov.
|
@@ -28,5 +30,15 @@ export async function webpack(config, options) { | |||
} | |||
|
|||
logger.info('=> Loading custom webpack config (extending mode).'); | |||
return mergeConfigs(finalDefaultConfig, customConfig); | |||
|
|||
// Restore 4.x behavior, but deprecate this mode of extending webpack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpackFinal
will be called twice again =(
since we are not passing the baseConfig
to the full control mode function, we can just move the call of the finalWebpack preset from line 16 into two first conditions (lines 24 and 29)
Issue: #6081 #5941 #6083 #5708 #6111
What I did
baseConfig
rather thandefaultConfig
How to test
{}