question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

include webpack that is being used to the webpackFinal function

See original GitHub issue

Is your feature request related to a problem? Please describe A clear and concise description of what the problem is. Ex. I’m always frustrated when […] it would be nice if when modifying webpack to pass the instance of webpack that is being used in storybook as part of the second parameter to webpackFinal so that you can destructure it to be something like:

webpackFinal: (config, { configType, webpack }) => {
....do stuff like webpack.DefinePlugin(...
return config;
}

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Are you able to assist to bring the feature to reality?**
yes, I can...

**Additional context**
Add any other context or screenshots about the feature request here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kelly-tockcommented, Apr 27, 2021

@ndelangen not sure I understand. It is common if you are overriding or adding to webpack to require webpack in this file. What can happen is you may end up with 2 different versions of webpack, and it can cause pretty cryptic error messages. So if you are say just adding a variable via define plugin, this won’t work if there are multiple versions of webpack. How would the code you suggested help folks to use the webpack that storybook is also using? Can you maybe expand that idea further?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack - Storybook
You can customize Storybook's Webpack setup by providing a webpackFinal field in .storybook/main.js file. The value should be an async function that ...
Read more >
All You Need to Know about Webpack in Examples - Medium
This article will cover all main ideas behind the webpack — module bundler. You will know how to configure webpack, add assets, add...
Read more >
Custom Webpack Config - Storybook
You can customize Storybook's webpack setup by providing a webpack.config.js file exporting a webpack 4 compatible config exported as a commonjs module.
Read more >
Webpack 5 and Storybook 6 integration throws an error in ...
Another small fix we had to do was to add this line in the storybook webpack.config.js file: config.resolve.fallback = { http: false, }....
Read more >
A Guide to Managing Webpack Dependencies - Toptal
Finally, we discuss how to configure Webpack, if we want to include third-party ... For this purpose, we can use require.ensure or System.import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found