Skip to content

Commit

Permalink
Fix ember-cli-babel@6 compatibility (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 authored and marcoow committed Apr 24, 2017
1 parent 22ab8a4 commit 9ceb7ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ module.exports = {
let checker = new VersionChecker(this).for('ember-cli-babel', 'npm');

app.options = app.options || {};
app.options.babel = app.options.babel || {};
app.options.babel.plugins = app.options.babel.plugins || [];

if (checker.satisfies('^5.0.0')) {
app.options.babel = app.options.babel || {};
app.options.babel.plugins = app.options.babel.plugins || [];
app.options.babel.plugins.push(require('./strip-data-test-properties-plugin'));
} else if (checker.satisfies('^6.0.0-beta.1')) {
app.options.babel.plugins.push(require('./strip-data-test-properties-plugin6'));
app.options.babel6 = app.options.babel6 || {};
app.options.babel6.plugins = app.options.babel6.plugins || [];
app.options.babel6.plugins.push(require('./strip-data-test-properties-plugin6'));
} else {
this.ui.writeWarnLine('ember-test-selectors: You are using an unsupported ember-cli-babel version. data-test ' +
'properties are not automatically stripped from your JS code.');
Expand Down

0 comments on commit 9ceb7ea

Please sign in to comment.