Is it possible to specify the root of the app for imports? For instance with webpack I can set up resolve.root in the config. If I have in my webpack config:
{
"resolve": { "root": "src" }
}
then
import 'client/someFile.js;
will look under ./src/client/someFile.js but Meteor will only look into ./node_modules and won’t find the file.
Importing by slash root is supported in Meteor out of the box.
You’ll want to keep most things in the /imports/ directory, because anything outside of there is “eagerly loaded” - which means it’ll get packaged up for both client and server (outside of the special meteor folders) by default.
There has been some talk about making it possible to configure the special directories, and make the default no longer “eager” but that hasn’t been delivered yet. For now you’ll want to keep things in /imports.