Bor*_*ard 25 intellij-idea node.js phpstorm webstorm
在WebStorm/PhpStorm/IDEA中,内置的JavaScript有很多代码智能功能.但是,在开发Node.js应用程序时,包括node_modules复杂的所有内容都与"导航到文件"有关(我不想要例如,IDE package.json从node_modules文件夹中提供数十个s .但是排除node_modules文件夹完全有其自身的问题 - 没有代码完成等.
那么在WebStorm中解决这个问题的"正确"方法是什么?我应该只包含一些文件node_modules吗?或者从那里排除所有内容并以某种方式使用项目或全局库的概念?
谢谢.
fnc*_*omp 23
要在UI中执行此操作(从PyCharm 2.7.3测试,结果显示在PhpStorm 6.0.3中):
添加JavaScript库

文件→设置
(项目设置)→JavaScript→库
[添加...]→
名称:node_modules
Visiblilty:[x]当前项目
[Attach ...]
{select project's node_modules folder}
{重复为凉亭 }
从项目中排除文件夹

(项目设置)→项目结构
右键单击文件夹→[排除]
要从项目的.iml文件执行此操作:
将项目更改.iml为以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/bower_components" />
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="node_modules" level="application" />
<orderEntry type="library" name="bower_components" level="application" />
</component>
</module>
Run Code Online (Sandbox Code Playgroud)
导致编辑器排除node_modules和bower_components,但使它们可用于完成和库搜索
在PyCharm,IntelliJ和WebStorm中测试过.
| 归档时间: |
|
| 查看次数: |
15497 次 |
| 最近记录: |