You can mark the path "..." as external to exclude it from the bundle - how?
P粉652495194
P粉652495194 2024-03-25 20:38:41
0
1
381

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?

P粉652495194
P粉652495194

reply all(1)
P粉011912640

Assuming you use esbuild for packaging, you should be able to use the --external flag:

esbuild entry.ts [...options...] '--external:'

Compare. https://esbuild.github.io/api/#external

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!