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
When following the starter guide and the using with typescript section in the README, the only type declaration file (d.ts) generated is the one specified in package.json#source. For example, let's say we have the following files in our src directory:
When I run npm run build, it only generates a single declaration file within the dist folder at the location specified in package.json#types. This does not work because the single declaration file includes imports to other declarations for types.d.ts which does not exist.
// dist/index.d.tsimporttype{Name}from"./types";// no `types.d.ts` in dist so it just says `any` and breaks all other types!exportdeclareconstname: Name;
The current work-around solution I have came up with is to just add another script to the package.json to generate the correct declaration files. Sadly, this does not make it automatically happen when saving files in microbundle, though.
My proposal for a solution would be to just read the directory that the source file is located in within the package.json file and emit all types within there as it seems like we're only generating the single types for the source file.
Edit: Sorry, I forgot to thank you for this amazing library! It's really been a complete joy working with until this nasty issue popped up.
The text was updated successfully, but these errors were encountered:
Should work out-of-the-box, might be something up with your tsconfig.json.
Here's a demo repository, feel free to take a look and see if you've done something differently.
Thank you very much for your quick response. It is working perfectly now. I'm very confused, because I can't reproduce the behavior now and I spent a long time yesterday trying to get it to work yesterday. Sorry for wasting your time.
Uh oh!
There was an error while loading. Please reload this page.
When following the starter guide and the using with typescript section in the README, the only type declaration file (d.ts) generated is the one specified in
package.json#source
. For example, let's say we have the following files in oursrc
directory:When I run
npm run build
, it only generates a single declaration file within thedist
folder at the location specified inpackage.json#types
. This does not work because the single declaration file includes imports to other declarations fortypes.d.ts
which does not exist.The current work-around solution I have came up with is to just add another script to the
package.json
to generate the correct declaration files. Sadly, this does not make it automatically happen when saving files in microbundle, though.My proposal for a solution would be to just read the directory that the
source
file is located in within thepackage.json
file and emit all types within there as it seems like we're only generating the single types for thesource
file.Edit: Sorry, I forgot to thank you for this amazing library! It's really been a complete joy working with until this nasty issue popped up.
The text was updated successfully, but these errors were encountered: