Webstorm: “Cannot Resolve Directory”

后端 未结 4 1084
鱼传尺愫
鱼传尺愫 2020-12-02 10:12

This is starting to bug me and I\'d either like it turned off or fixed. So Webstorm has a sweet feature in it\'s HTML parser that will attempt to resolve directories in stri

相关标签:
4条回答
  • 2020-12-02 10:40

    I had this problem on Mac and solved it by changing the directories properties.

    1. Open Preferences:

    Webstorm > Preferences

    1. Go to Directories section in the Preferences

    Project > Directories

    1. Add content root and Resource roots

    Screenshot after adding the resources root

    0 讨论(0)
  • 2020-12-02 10:45

    In JetBrains WebStrom Goto File-->Settings-->Left Panel Select Project-->Click on Derectories-->Middle Panel Select Resource Root-->add the folders/Directories under your Project for reference or In the Right Panel You Can see +Add Content Root choose the directories and the Apply-->OK

    0 讨论(0)
  • 2020-12-02 10:47

    for people using IntelliJ Ultimate:

    enter image description here

    0 讨论(0)
  • 2020-12-02 11:02

    To make file references to a non-root folder in your project, you'll need to mark that directory as a Resource. To do this, go to Settings > Directories and select your asset root folder from the right-hand panel. Then mark it as Resource Root by clicking the button above the file browser.

    From the Jetbrains documentation, a Resource Root enables WebStorm to complete relative paths to resources under the selected folder. This means that you should use Resource Root on a folder that holds all the resources you would like to refer to (e.g. styles, scripts, ...).

    0 讨论(0)
提交回复
热议问题