-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve packaging: webpack uses UMD build, inlines immer, selectorator, etc. #55
Comments
This should be resolved in https://github.com/reduxjs/redux-starter-kit/releases/tag/v0.3.2 . |
Hmm. I take that back - the fix in 0.3.2 resolved the UMD build issue, but I also see the rest of the libs getting pulled into the output. Per the example from #68 , I assume this is because we're pulling it from the RSK index file, and that's causing things to not get tree-shaken. I don't even pretend to understand what contortions you have to go through these days to get tree shaking to work properly. Open to suggestions :) |
Based on what I'm seeing in the 1.3 alphas, pretty sure this is fixed by now. |
…seQuery (#55) * Add prepareHeaders * Update QueryApi types and tests * Update buildThunks * Add auth example and token usage to examples * Fix Matcher types, add an example of `extraReducers` with a matcher Co-authored-by: Lenz Weber <mail@lenzw.de> Co-authored-by: Matt Sutkowski <msutkowski@gmail.com>
The goal: Ideally, if I only import
createAction
then I wouldn't expectimmer
orselectorator
to be pulled into my bundle. This is the intention behind the ESM build pointed to by themodule
field in this library's currentpackage.json
.Unfortunately, webpack in its default configuration (including how it's configured in frameworks like Next.js) prefers the
browser
field tomodule
, so the entire 103KB UMD build is pulled in no matter what you import. Instead of requiring people to fiddle with a non-default webpack config, it would be better to behave nicely with the defaults.If you check out the
package.json
forredux
andreact-redux
, they don't specify thebrowser
field at all – instead, the UMD build is linked in theunpkg
field. That way, webpack will prefer themodule
build but there's still a UMD build included.This comment also suggests a potential way that these fields could behave together, by providing
browser
alternatives to both the ESM and CJS entry points. I'm not sure how that works exactly, but might be worth exploring.The text was updated successfully, but these errors were encountered: