Skip to content

Commit

Permalink
fix[babel options] don't overwrite existing babel options (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
kybishop committed Jul 8, 2017
1 parent cb0b48a commit 5611c50
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
18 changes: 11 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ module.exports = {
]
};

this.options.babel = {
plugins: [
[FilterImports, strippedImports],
[RemoveImports, 'ember-attacher/-debug/helpers']
],
postTransformPlugins: [StripClassCallCheck]
};
// In some versions of Ember, this.options is undefined during tests
this.options = this.options || {};

// Make sure the babel options are accessible
let babelOptions = this.options.babel = this.options.babel || {};
babelOptions.plugins = babelOptions.plugins || [];
babelOptions.postTransformPlugins = babelOptions.postTransformPlugins || [];

babelOptions.plugins.push([FilterImports, strippedImports]);
babelOptions.plugins.push([RemoveImports, 'ember-attacher/-debug/helpers']);
babelOptions.postTransformPlugins.push(StripClassCallCheck);
}

this._hasSetupBabelOptions = true;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ember-cli-babel": "^6.3.0",
"ember-cli-htmlbars": "^1.3.3",
"ember-cli-sass": "^7.0.0",
"ember-popper": "^0.3.1",
"ember-popper": "^0.3.2",
"ember-truth-helpers": "^1.3.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2487,9 +2487,9 @@ ember-native-dom-helpers@^0.5.0:
broccoli-funnel "^1.1.0"
ember-cli-babel "^6.1.0"

ember-popper@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/ember-popper/-/ember-popper-0.3.1.tgz#9593d9e5ccddc909f4d7be3359c596edcc88f0d1"
ember-popper@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/ember-popper/-/ember-popper-0.3.2.tgz#4adcd33fc1a3126eb2e07a76021b12c31ca40c31"
dependencies:
babel-plugin-filter-imports "^0.3.1"
babel6-plugin-strip-class-callcheck "^6.0.0"
Expand Down

0 comments on commit 5611c50

Please sign in to comment.