Let's say I'm exporting a library with a file structure like
|__ src
| |__ index.ts
| |__ other-file.ts
And I'd like to consume it like
import { something } from 'library'
import { other } from 'library/other-file'
How should I structure the output in order to achieve that?
How should I structure the output in order to achieve that?
|__ lib
| |__ index.js
| |__ index.d.ts
| |__ other-file.js
| |__ other-file.d.ts
|__ src
| |__ index.ts
| |__ other-file.ts
With tsconfig.json having outDir:lib/ declaration:true/ include:['src'].
Use will look like:
import { something } from 'library'
import { other } from 'library/lib/other-file'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With