如何使用加载程序导入本地打字稿软件包

发布于 2025-01-22 07:19:09 字数 446 浏览 5 评论 0原文

我正在开发自己的打字稿软件包,可以在React项目中导入。

为了在开发时对其进行测试,我使用npm链接链接了本地包,并使用create> create-react-app cli创建了一个打字稿React项目。

导入我的软件包时,以下错误发生。

File was processed with these loaders:
 * ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
 * ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.

我该如何修复?

I am developing my own typescript package which can be imported in react projects.

In order to test it while developing, I have linked the package locally using npm link and created a typescript react project using create-react-app cli.

When importing my package, following error happens.

File was processed with these loaders:
 * ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
 * ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.

How can I fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文