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?
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?
lhz516
July 5, 2018, 12:23am
4
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
coagmano:
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.
docs.meteor.com
Documentation of Meteor’s less
package.
That should sort it out without needing an imports directory!
It’s really helpful. Thanks!