-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Support other type of webpack configs #3785
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3785 +/- ##
==========================================
- Coverage 40.98% 40.66% -0.32%
==========================================
Files 453 454 +1
Lines 5100 5139 +39
Branches 861 872 +11
==========================================
Hits 2090 2090
- Misses 2493 2521 +28
- Partials 517 528 +11
Continue to review full report at Codecov.
|
@Hypnosphi It looks like the check fails because of yarn registry. Could you rerun it? |
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.
I'm not very comfortable with copy-pasting the code from webpack sources, but it's probably the best we can do now.
Can you please open an issue for https://github.com/webpack/webpack-cli and ask them to make config resolution logic available for external usage? Babel does a similar thing in v7: babel/babel#7472
@Hypnosphi the problem is that storybook could accept different type of configurations (even the file names are same with webpack one, storybook takes different function like custom config) |
lib/core/src/server/config.js
Outdated
@@ -58,6 +59,87 @@ function informAboutCustomConfig(defaultConfigName) { | |||
logger.info(`=> Using default webpack setup based on "${defaultConfigName}".`); | |||
} | |||
|
|||
// Copied and modified from |
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.
Please extract all these to a separate file.
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.
OK, I will extract them into webpack_config
. Is it what you expect?
Yes, we only need to resolve the filename |
@igor-dv Could you check this again? |
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.
Let's rename webpack_config
to the loadCustomWebpackConfig
and we are OK.
@igor-dv Is there any reason for snake_case file name and camelCase file name? I mean, |
I am not surer about the convention, but it's more about maintenance/readability. I would also change the |
Also related to an older issue - #3125. |
I think I found a regression:
|
Do not forget to install |
@87Hz What do you mean? Why am I installing that and where would I use it? I'm getting the same error as @nickmccurdy but with |
That is to ensure |
Issue: #3780.
What I did
Add
interpret
package to support other type (.ts
,.babel.js
, ...) of webpack config files.How to test
Install
ts-node
andtypescript
inofficial-storybook
in example directory, and changewebpack.config.js
towebpack.config.ts
, and finally changerequire
s toimport
s.Is this testable with Jest or Chromatic screenshots? No
Does this need a new example in the kitchen sink apps? No
Does this need an update to the documentation? I'm not sure.