Search code examples
intellij-ideawebstormjetbrains-ide

WebStorm: Exclude folders by pattern


this is how a .idea/${repo}.iml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
  <component name="NewModuleRootManager">
    <content url="file://$MODULE_DIR$">
      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
      <excludeFolder url="file://$MODULE_DIR$/temp" />
      <excludeFolder url="file://$MODULE_DIR$/tmp" />
      <excludePattern pattern="*.log" />
      <excludePattern pattern="*.lock" />
      <excludePattern pattern="dist/*" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>

this is a screenshot of my preferences > directories configuration:

enter image description here


Expected:

Being able to mark directories as excluded by pattern, so I can ignore multiple folder at once. (I use a monorepo and have multiple dist dirs)

Actual

Files under dist are still being indexed, even while the folder dist is marked with a different color. enter image description here


using WebStorm 2019.1.3


Solution

  • dist should work, dist/* won't - excluding files/folders by relative path pattern is not supported, see IDEA-173675