WEB-7235 Improve handling of "packages" folders (no risk to IDEA, needed for today's WebStorm RC)
(cherry picked from commit 7f59f42)