Skip to content

Commit

Permalink
Avoid polyfills / ENV setup in Ember 2.x scenarios.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Jan 9, 2018
1 parent 88adda1 commit cea3d3b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
/* eslint-env node */
'use strict'

const VersionChecker = require('ember-cli-version-checker');

module.exports = {
name: 'ember-2-legacy',

init() {
this._super && this._super.init.apply(this, arguments);

let checker = new VersionChecker(this);
this.emberVersion = checker.forEmber();
},

config() {
// do nothing if running with Ember 2.x
if (this.emberVersion.lt('3.0.0-alpha.0')) {
return;
}

return this._super.config.apply(this, arguments);
},

included() {
this._super.included.apply(this, arguments);

// do nothing if running with Ember 2.x
if (this.emberVersion.lt('3.0.0-alpha.0')) {
return;
}

this.import('vendor/ember-k.js');
this.import('vendor/safe-string.js');
this.import('vendor/enumerable-contains.js');
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"test": "ember try:each"
},
"dependencies": {
"ember-cli-babel": "^6.6.0"
"ember-cli-babel": "^6.6.0",
"ember-cli-version-checker": "^2.1.0"
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
Expand All @@ -36,8 +37,8 @@
"ember-cli-uglify": "^2.0.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-resolver": "^4.0.0",
"ember-qunit-assert-helpers": "^0.2.1",
"ember-resolver": "^4.0.0",
"ember-source": "http://builds.emberjs.com/beta/shas/08bc55d20f76f874b6a7ceefd4007dde1aa7c9dc.tgz",
"eslint-plugin-ember": "^5.0.0",
"eslint-plugin-node": "^5.2.1",
Expand Down

0 comments on commit cea3d3b

Please sign in to comment.