3 ms·
For me it was just trial and error and copious use of IDE hinting to figure out the nuances of various import forms. You find out pretty fast what doesn't work,
by jimmygrapes 4y ago
For me it was just trial and error and copious use of IDE hinting to figure out the nuances of various import forms. You find out pretty fast what doesn't work, then just gotta figure out what mistake leads to what part not working.
As far as the tsconfig goes, I'm with you there; the documentation is a little chaotic and a lot unhelpful. What I have learned to do is start a fresh one every time, enable the strictest settings I can, set up my source code and output structure explicitly (outDir, rootPath, etc.) based off of the comments in a fresh tsconfig.json file, and then leave it alone.
From the various blogs and forum posts I've seen, most people get tied up because they insist on adding all kinds of additional tooling up front. Babel, esbuild, snowpack, jest, the list goes on. Don't do that. Maybe later, if needed, but honestly tsc does the majority of that stuff just fine. Don't prematurely optimize your build and deployment timeline if you can't get imports to work yet.
- w3456yhbvr5yh 4y agoThis is an accurate description of my experience also: - trial & error - leave it alone - don't add stuff I don't use babel or webpack and have many examples of "working" configs, but none of it adds up to a reproducible or stable process. Any random import might or might not `export` compatibly. The compiler barely helps, and people are left flipping toggles in the package.json and tsconfig.json hoping that some combo works for what they intend.