I wrote a package let's call it commons and another project that imports it.
I do not want to import the whole package but only one subpath of this package.
import { client } from '@commons/clients' instead of import { client } from '@commons'
I have seen typescript packages such as jose that enable such behavior.
E.g. import createRemoteJWKSet from 'jose/jwks/remote'.
After some research, I did see that I can define in package.json this behavior with exports key. Unfortunately, this seems to work only for pure js and not typescript as far as I tested it.
Also, I have found that typescript doesn't support exports yet in some thread.
How does a package such as jose manage this?
write a package with the option to import subpaths typescript
1.2k Views Asked by Hein Re At
1
There are 1 best solutions below
Related Questions in TYPESCRIPT
- It doesnt always show all the books on my homepage
- S3 integration testing
- Make some of the type's field optional
- storybook 7 does not recognize module declarations
- Page in React only renders elements after refreshing
- Error Inserting into Supabase: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member
- vscode, debug angular, first time, doesn't debug, 2nd time stops at main.js then it's ok
- Get remote MKV file metadata using nodejs
- Vue/TailwindCSS - Content is behind Sidebar
- TypeScript Error only on big type only when assigned to a variable
- pnpm firebase app "Could not find a declaration file for module 'mime'"
- TypeScript: Type checking while parsing an arbitrary JSON that is typed/
- Issue with BBCode image tag on React
- Typescript: returnType based on value 'single' prop
- Failed to resolve import, but the path is valid, and detected as such by VSCode
Related Questions in PACKAGE
- How to install libfuse2 on Ubuntu 22.04
- chatbot respond to onequery type
- How to get argument from Command line for my python package
- How can I record the entire screen outside of my Flutter app or control a specific area for recording, including sound?
- hashcat : Depends: libminizip1t64 but it is not installable E: Unable to correct problems, you have held broken packages
- OS: Parrot OS (hashcat : Depends: libminizip1t64 but it is not installable)
- Flutter: when I try to hot reload to run the app I get this error when using carousel slider "Error: Couldn't resolve the package 'carousel_slider "
- Could not create '.egg-info': The system cannot find the file specified
- How to implement facebook pixel in flutter in 2024 any example?
- Flutter error on using local_auth package and conflicts with other packages
- Eclipse: "package...does not exist" when building a Maven package that references a class in another project
- Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1Error:
- Export and create package of c++20 modules
- Enforce schema on schemaless DynamoDB database
- Problem with the packages file in my flutterflow project on Visual Code Studio
Related Questions in JOSE
- How to verify JWS (x5c chain) is signed by apple using Jose
- How can I sign a JWT with RS256 using PS256 private key in node.js
- How to create a key.pem with RSA-PSS parameters in openssl that meet the PS256 requirements?
- JOSE ConfigurableJWTProcessor Issue
- Mock jose.jwtVerify with jest
- How to verify a Firebase ID token using jose in node?
- Struggling to verify a JWT token in Node.js
- Can't verify access token in middleware nextjs
- Unknown issuer - error suddenly appeared without modifying my own code or updating dependencies
- Invalid signature of generated JWT
- Jose JWE js to python translation not fully working (Solved)
- How do I verify a Firebase sessionCookie (JWT) using jose?
- how to decode and verify aws cognito JWT IdToken from nodeJS and Browser?
- Issues with decoding recipient encrypted key in dart
- Generated JWT gets Invalid Signature in jwt.io
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This is supported in TypeScript but not by the default module resolution. To allow TypeScript to resolve the module, you need to use either
Node16orNodeNextfor yourmoduleResolutionfield intsconfig.json.