You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I realize this is really more of a TS question than it is an attw question, but given our recent discussions I figured it was worth filing here. Feel free to close this once you see it.)
Using the CLI wrapper I've set up for attw, I get this output:
I'm getting that FalseCJS warning, and I'm guessing it's because I have dist/index.mjs but dist/index.d.ts.
A few questions based on that:
How critical is that mismatch in general? I know you've mentioned that "CJS and ESM output files can/should have different types". How much of a concern is that actually in practice? How much effort should I spend on trying to resolve this attw warning?
redux-thunk only has the one output index.d.ts file. For RTK, we have many source files, and thus many.d.ts files:
Does only the index.d.mts file need to exist with that extension (ie, there could be index.d.mts and otherFile.d.ts and that would work)? Or does every output declaration file need to have the .d.mts extension for TS to load those properly in the ESM case?
We've briefly discussed trying to bundle up TS declarations. What is the right tool for that currently?
(I realize this is really more of a TS question than it is an
attwquestion, but given our recent discussions I figured it was worth filing here. Feel free to close this once you see it.)I'm working on redoing the
redux-thunkbuild setup atm, and also trying out https://github.com/egoist/tsup as a potential build tool.My current package setup looks like this:
Using the CLI wrapper I've set up for
attw, I get this output:I'm getting that
FalseCJSwarning, and I'm guessing it's because I havedist/index.mjsbutdist/index.d.ts.A few questions based on that:
attwwarning?tsupdoesn't currently have a way to generate.d.mtsoutput , per [feature] Generate esm-specific declaration files egoist/tsup#760 . Is it reasonable to copy overindex.d.ts->index.d.mtsin this case?redux-thunkonly has the one outputindex.d.tsfile. For RTK, we have many source files, and thus many.d.tsfiles:index.d.mtsfile need to exist with that extension (ie, there could beindex.d.mtsandotherFile.d.tsand that would work)? Or does every output declaration file need to have the.d.mtsextension for TS to load those properly in the ESM case?