[SOLVED] How to control loading order of less files outside imports directory?

In Meteor 1.7, we no longer need imports directory because we can specify the entry point in package.json like this:

"meteor": {
  "mainModule": {
    "client": "client/main.js",
    "server": "server/main.js"

However, if I add less package, all less files will be loaded. How can I manually control the loading order of less files without using imports directory?

Hi, Does anyone know?

I think even with mainModule, the imports directory is still exempt from eager loading?
Does it work if you put your less files in there?

Yes, imports directory still works. However, the purpose of using mainModule is to get rid of imports directory. It looks weird to use both.

Actually i just looked at the docs:

If you want to @import a file, give it the extension .import.less to prevent Meteor from processing it independently.

That should sort it out without needing an imports directory!

1 Like

It’s really helpful. Thanks!