I'd prefer if this worked out-of-the box, even if it meant we have to make the detection more complex. We could look for a presence of package.json file for example.

Few options for making this algorithm configurable:
- If we had a project-level configuration file, then the root path could go there.
- An environment variable with a list of directories to look for sources.
- Snippet of javascript code in the global config file that will implement (override) logic for finding application root.