Expose Webpack bundle5 for development of external packages #25557
eric-burel
started this conversation in
Ideas
Replies: 1 comment
-
I've also tried to do the same directly in a fork of Next, same result because Storybook will still load it's own webpack: lbke#1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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 bynext/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
intonode_modules/webpack/lib/index.js
, the hard way.It leads to
_webpack.DefinePlugin is not a constructor
.Another alternative would be to remove the explicit dependency to webpack in @next/plugin-storybook.
Reproductions
with-storybook-experimental
, try to install and runyarn run storybook
Beta Was this translation helpful? Give feedback.
All reactions