【问题标题】:How to get autocomplete with CSS Framework in VS Code when you installed them via NPM and exclude the node_modules folder?当您通过 NPM 安装 CSS 框架并排除 node_modules 文件夹时,如何在 VS Code 中使用 CSS 框架自动完成?
【发布时间】:2020-09-04 03:58:11
【问题描述】:

例如,如果我想通过 npm 让 Bulma 进入我的项目(在文档中推荐),我是这样安装的

npm install bulma

还有位于node_modules 的文件。这就是问题发生的地方。

通常,我会在 VS 代码中排除该文件夹以获得更好的性能。

在 VSCode 上显示 CSS 自动完成功能的 2 个扩展是 HTML/CSS supportIntellisense for CSS class names in HTML 将不支持隐藏的 node_modules 中的 CSS 文件。

(感谢CSS files in folders excluded with files.exclude do not get parsed issue 上的@garyking 指出这个问题)

我们有什么解决办法吗?

【问题讨论】:

    标签: npm visual-studio-code autocomplete bulma css-frameworks


    【解决方案1】:

    我的解决方法是:

    1:再次在 VS Code 中显示 node_modules 文件夹(VSCode 团队说这对性能不利)

    2:在 VS Code setting.json 上使用这个技巧:

      "files.exclude": {
        "**/node_modules/{[^b],?[^u],??[^l],???[^m]}*": true
      }
    

    (更多信息请查看本期VS Code - Exclude all files except for...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-31
      • 2020-06-23
      • 1970-01-01
      • 2017-11-21
      • 2014-04-29
      • 1970-01-01
      相关资源
      最近更新 更多