[英]How to find an ES6 import module without a relative path?
I have an ES6 import. 我有一个ES6导入。
import MyAwesomeComponent from 'packageNameOnlyWithoutPath';
I want to inspect the file packageNameOnlyWithoutPath
. 我想检查文件
packageNameOnlyWithoutPath
。 But I can't find it. 但是我找不到。 I looked in
node_modules
but I don't see it there. 我查看了
node_modules
但在node_modules
看不到。 So it might be hiding out elsewhere in the app. 因此它可能隐藏在应用程序的其他位置。
Is there a canonical way to find the path that leads to packageNameOnlyWithoutPath
? 有没有找到通往
packageNameOnlyWithoutPath
的路径的规范方法?
you might want to take a look at index.js file in the packageNameOnlyWithoutPath folder inside the node_modules. 您可能想看看node_modules内packageNameOnlyWithoutPath文件夹中的index.js文件。 Else use text editors which supports goToDefinition plugin
其他使用支持goToDefinition插件的文本编辑器
TL;DR: Check resolve aliases in Webpack (or similar bundler) config or .babelrc
TL; DR:在Webpack(或类似的捆绑程序)配置或
.babelrc
检查解析别名
There's two places you can check first. 您可以先检查两个地方。
You should find what you're looking for in one of the above. 您应该在上述之一中找到所需的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.