Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  4] [ 2]  / answers: 1 / hits: 59605  / 10 Years ago, mon, february 24, 2014, 12:00:00

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 strings that are supposed to reference a file in your project. For example:



two



Webstorm is correct. My front end code is all in /app but my server serves up files in app on the root, so in the web context /app is actually just /. As a side, this behavior also impacts my angular templates:



webstorm



and my angular-ui routes (I imagine it would do that for regular angular routes as well).



webstorm



Is there a way that I can change webstorm to treat /app as the root so this is a useful feature? If not, is there a way I can disable this? I tried going into the inspector, but couldn't find an option for it:



webstorm



And no, it's not the XML one... I tried.



Help appreciated. Thanks...


More From » html

 Answers
5

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, ...).


[#72344] Saturday, February 22, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tyreem

Total Points: 540
Total Questions: 94
Total Answers: 90

Location: Palestine
Member since Tue, Jul 20, 2021
3 Years ago
;