Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Expose Webpack bundle5 for development of external packages #25552

Closed
eric-burel opened this issue May 28, 2021 · 0 comments
Closed

Expose Webpack bundle5 for development of external packages #25552

eric-burel opened this issue May 28, 2021 · 0 comments

Comments

@eric-burel
Copy link
Contributor

Describe the feature you'd like to request

I need to use Next.js webpack 5 bundled version in a non-Next application (Storybook).

I need this to allow further development of @next/plugin-storybook, within the following demo application that relies on it: https://github.com/lbke/next-plugin-storybook-demo.
I experience conflicts, because Storybook will install its own version but Next and thus @next/plugin-storybook will rely on their own homemade bundle.

Describe the solution you'd like

Expose Webpack 5 bundle5.js file in Next, for instance as a package, so that it can be used instead of Webpack in end-user application.
Also, I am not sure how I could alias this package, so that webpack is replaced by next/webpack basically (since it's webpack itself, I am not sure I can use a Webpack alias as usual).

Describe alternatives you've considered

Using Yalc to avoid any issue with linking, then copy pasting bundle5.js into node_modules/webpack/lib/index.js, the hard way.
It leads to _webpack.DefinePlugin is not a constructor.

Reproduction and documentation here: https://github.com/lbke/next-plugin-storybook-demo

@vercel vercel locked and limited conversation to collaborators May 28, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants