I have a repository that has been published to packages. I installed this package in another repository and want to use it, but I get the error: (where ...
is the name of any package I try to import in my package)
X [ERROR] Could not resolve "@.../..." ../../node_modules/.../.../src/.../....ts:6:7: 6 │ import "@.../..."; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can mark the path "@.../..." as external to exclude it from the bundle, which will remove this error. X [ERROR] Could not resolve "@.../..." ../../node_modules/.../.../src/.../....ts:7:7: 7 │ import "@.../..."; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to refactor the url so that the package can be used?
Assuming you use
esbuild
for packaging, you should be able to use the--external
flag:Compare. https://esbuild.github.io/api/#external