简体   繁体   中英

How should I specify a minimum version of Ember.js in my ember-cli addon?

I've just published an ember-cli addon using features available only in projects that have updated to Ember 2.x by making the required changes to their package.json and bower.json .

How should I specify that the addon will only work with Ember 2.x?

Very late answer, but I found this question while searching for this myself.

The answer is to require ember-cli-version-checker . The documentation gives several examples, but to require a minimum version of Ember itself you would do

 //index.js let VersionChecker = require('ember-cli-version-checker'); module.exports = { name: 'awesome-addon', init() { let checker = new VersionChecker(this); checker.for('ember-cli').assertAbove('2.0.0', 'To use awesome-addon you must have ember-cli 2.0.0'); } }; 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM