Skip to content

Commit

Permalink
Import correct ember-template-compiler version based on Ember version
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Novy committed May 4, 2017
1 parent 44ee436 commit 3960192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18,227 deletions.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-env node */
'use strict';

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

module.exports = {
name: 'ember-component-playground',

Expand All @@ -13,6 +15,7 @@ module.exports = {
// this.ui.writeLine('Configuring ember-component-playground');

const vendor = this.treePaths.vendor;
const checker = new VersionChecker(this);

// see: https://github.com/ember-cli/ember-cli/issues/3718
// Find the parent app by crawling addon tree
Expand Down Expand Up @@ -57,7 +60,11 @@ module.exports = {
app.options.codemirror = codemirrorConfig;

// Required to compile templates at runtime
app.import(`${vendor}/ember-template-compiler.js`);
if (checker.forEmber().satisfies('>= 2.11.0')) {
app.import('vendor/ember/ember-template-compiler.js');
} else {
app.import('bower_components/ember/ember-template-compiler.js');
}
// Required for ember template highlighting
app.import(`${vendor}/htmlhandlebars.js`);
// Structural styles for the playground
Expand Down
Loading

0 comments on commit 3960192

Please sign in to comment.