Best way to support Meteor 1.1 and 1.2 with LESS

Hi,

I’m trying to update some packages I use that require LESS. These packages all just require “less” with no version, but Meteor seems to interpret that as requiring version 1.x. To get these to work with Meteor 1.2 all I’ve needed to do is update that to “less@2.5.0”. But if I do that, and then distribute the modified packages, these packages will not be compatible with Meteor 1.1.

What is the right way to support both? Can I simply do a branching statement in the package.js file for each package, and detect the version of Meteor I’m using? If so, how do I get the Meteor version number in script?

Thanks,

Kevin N.

To support both versions, you could do:

api.use('less@1.0.0 || 2.0.0');
1 Like

Yep, that’s what I did. Thank!