#Creating a typescript lib, cannot import

14 messages · Page 1 of 1 (latest)

dusty marsh
sullen yarrow
#

@dusty marsh Doesn't look like the built version is getting published

#

package.json says "main": "./dist/index.js",, but there's no dist directory in the published package.

dusty marsh
#

ah, I guess I don't run build in my gh action

#

Is there anything special I need to do for type support outside of adding bun build?

sullen yarrow
#

Not familiar with the bun tooling, but you should end up with dist/index.js and dist/index.d.ts

#

Oh and probably the package.json should not be pointing at the .ts file:
"types": "./src/index.ts",

dusty marsh
sullen yarrow
#

Looks like your tsconfig doesn't say to generate declarations

#

Try "emitDeclarationOnly": true

#

For "types" in package.json generally you'll either point it at dist/index.d.ts or if you just omit it, it'll look for a same-named .d.ts file as your main file which is generally what you want anyway.

severe compass
sullen yarrow