解决phpstorm打开vue项目不显示node_modules文件夹
背景
用phpstorm打开vue项目不能显示node_modules文件夹,不方便查看扩展包源码。
解决
原因:问题是由PHP设置引起的 - 如果将项目目录添加到PHP包含路径,则不将node_modules
视为库根。
官方文案:https://youtrack.jetbrains.com/issue/WEB-33211
原文:
node_modules is not treated as library root if project directory is added to PHP include paths
create a new PHP empty project
add a
package.json
in terminal, run
npm i bootstrap --save
=> packages are installed, node_modules auto-excluded and added to Javascript Librariesin File | Settings | Languages & Frameworks | PHP, Include Path tab, add
.
as include pathapply settings - note that node_modules are included and NOT marked as a library root
解决phpstorm打开vue项目不显示node_modules文件夹
http://blog.icy8.cn/posts/18507/