我有一个已发布到包的存储库。我在另一个存储库中安装了这个包并想使用它,但出现错误:(其中 ... 是尝试在我的包中导入的任何包的名称)
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 "@.../...";
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
如何重构 url 以便可以使用该包?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
假设您使用
esbuild进行打包,您应该能够使用--external标志:比照。 https://esbuild.github.io/api/#external