-
-
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
fix: Correct build outputs #3211
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit bfea34d:
|
Came back to fix up any remaining test issues (sorry for the long delay), but looks like it was just an issue with my Node version. Didn't realize the project targets v16+, so nullish coalescing syntax errors aren't actually an issue. I'll mark this as ready for review, but feel free to copy/paste or fold into anything else, obviously this change is quite tiny and is just implementing what we talked about in the linked issue. Edit: Hm, looks like something is going wrong when testing against Edit2: Best guess is yarn is doing something weird when resolving modules, but I'm really unfamiliar with v2+. I'll reopen this but there might still be an issue with the CI and/or testing setup. |
The build errors all say it can't find the |
Oh god dammit, it's the I was testing with Gonna start making notches in my desk for every time that's screwed me up, been quite a few times over the years. Note: |
1348302
to
157536c
Compare
OOOOO-kay! After a very long day today (and a bunch more hours on previous weekends), I have finally come up with a set of packaging changes that appears to be as "correct" as I think we're gonna get, and I've got it being verified via a battery of CI tests that build and run a set of example apps using the PR build artifact. There's also a CI test that uses I've published new alphas of Here's what I ended up with for "main": "dist/cjs/redux.cjs",
"module": "dist/redux.legacy-esm.js",
"types": "dist/redux.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/redux.d.ts",
"import": "./dist/redux.mjs",
"default": "./dist/cjs/redux.cjs"
}
}, Note the use of Similarly, for RTK: "module": "dist/redux-toolkit.legacy-esm.js",
"main": "dist/cjs/index.js",
"types": "dist/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/redux-toolkit.modern.mjs",
"default": "./dist/cjs/index.js"
},
"./query": {
"types": "./dist/query/index.d.ts",
"import": "./dist/query/rtk-query.modern.mjs",
"default": "./dist/query/cjs/index.js"
},
"./query/react": {
"types": "./dist/query/react/index.d.ts",
"import": "./dist/query/react/rtk-query-react.modern.mjs",
"default": "./dist/query/react/cjs/index.js"
}
}, And then I'm still having to use the fallback Those changes are over in #3318 , which I'm about to merge. Thank you for helping sort out what the apparently-right keys are and pointing me in the right direction! |
Closes #3208