Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Webpack 5 / Future plans regarding webpack #2158

Closed
brillout opened this issue Dec 16, 2021 · 3 comments
Closed

Webpack 5 / Future plans regarding webpack #2158

brillout opened this issue Dec 16, 2021 · 3 comments
Assignees
Labels
feature Feature requests and suggestions webpack Issues that involve the `webpack` bundler

Comments

@brillout
Copy link

I know the current recommendation is to either use wrangler's webpack v4 based bundler or a custom build/bundler.

Do you plan to make wrangler's bundler use webpack 5 instead of webpack 4?

My users (I'm the author of vite-plugin-ssr) are confused about what you officially recommend to do. Do you plan to deprecated webpack? Or will wrangler migrate to webpack 5?

I know the official docs say that you will continue support the "webpack" build. But webpack v4 is already starting to become "deprecated software" (e.g. it doesn't seem to support package.json#exports). So wrangler will, sooner rather than later, have to decide to either deprecate webpack altogether or migrate to webpack 5.

Some clarification would be nice so we can properly invest in the right tools.

@brillout brillout added the feature Feature requests and suggestions label Dec 16, 2021
@threepointone
Copy link
Contributor

I can provide some clarity here.

wrangler will not be updating the webpack dependency to webpack 5. Further, we'll be phasing out support for the type field in wrangler.toml. (the type rust already is the same code path as the javascript code path, in that you need to define a build command anyway)

wrangler 2 (in active development at https://github.com/cloudflare/wrangler2) comes with esbuild internally, so a number of common usecases for a bundler (modules, npm dependencies, jsx, stripping types etc) work out of the box for entry points. You can still use your own build systems, and point wrangler at the output of that, of course.

We will provide an automated eject script for existing projects that use type = "webpack" so as to not break existing projects; thus also giving consumers a way to upgrade their webpack dependency themselves if they so prefer.

Once we start rolling out wrangler 2 (in early 2022), we will also amend the documentation and starter kits to reflect this guidance.

I'll also comment on the linked issue (vikejs/vike#217) re: guidance around streaming in a bit, but I hope the above is clear.

I'll assign this issue to myself leave this issue open until we have documentation regarding the deprecation and the automatic ejection/transition. Happy to answer any more questions.

@threepointone threepointone self-assigned this Dec 16, 2021
@threepointone threepointone added the webpack Issues that involve the `webpack` bundler label Dec 16, 2021
@brillout
Copy link
Author

That's super helpful, thanks for the thorough insights.

@penalosa
Copy link
Contributor

Thanks for reporting this issue! Wrangler v1 is now deprecated and support is only being provided for critical updates or security concerns. As such, we are closing this issue.

New versions of Wrangler are maintained in the workers-sdk repo. If you are running into a similar issue with wrangler v2, please report it in the workers-sdk repo. For more info about wrangler v1 deprecation, please check out our blog post.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions webpack Issues that involve the `webpack` bundler
Projects
None yet
Development

No branches or pull requests

3 participants