Export Typescript Client in npm package
See original GitHub issueIs there a reason the Client
is not exported in the types?
It would be great to not have to reference a static path like this:
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Allow export of Client, Server and Common modules ...
I have a project (lets call it FlatEarth) with client-only, server-only and common components. I would like to create a single npm package...
Read more >Step by step: Building and publishing an NPM Typescript ...
Typescript will then also export type definitions together with the compiled javascript code so the package can be used with both Typescript and ......
Read more >Build and publish an NPM Typescript package | Codementor
Typescript will then also export type definitions together with the compiled javascript code so the package can be used with both Typescript and ......
Read more >Creating a TS-written NPM package for use in Node-JS or ...
We'll be writing a src/index.ts file importing all of our library, and use the Typescript compiler to generate a Javascript variant in dist/ ......
Read more >How To Use Modules in TypeScript | DigitalOcean
In TypeScript, when targetting a module loader that supports overwriting the exported object, you can change the value of the exported object by ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@olexandr-mazepa it is a bad practice to import from a publish package from a static path. The reason this is a bad pattern is because the directory structure of a package is an implementation detail that should only be known to the publisher of the package, thus, it can change at any time. The published directory structure is not part of the public API of a package, that is why the
main
andtypes
properties exist in thepackage.json
, to point the resolution engine (common.js, esm, etc.) to the file that should be imported.I’ve just merged the PR and published a new version on npm. So that you can use version 5.0.0 to be able to use the new approach for importing types.