Skip to content

Commit

Permalink
Merge pull request #123 from rwjblue/avoid-passing-options-to-babel
Browse files Browse the repository at this point in the history
Only pass provided options to babel-preset-env.
  • Loading branch information
rwjblue authored Mar 21, 2017
2 parents 60d12de + 0b470fc commit a6d01ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ module.exports = {
let providedConfig = this._getProvidedBabelConfig();
let shouldCompileModules = this._shouldCompileModules();

let options = providedConfig.options;
let options = {};
let userPlugins = providedConfig.plugins;
let userPostTransformPlugins = providedConfig.postTransformPlugins;

Expand Down
12 changes: 12 additions & 0 deletions node-tests/addon-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,18 @@ describe('ember-cli-babel', function() {
describe('_getBabelOptions', function() {
this.timeout(20000);

it('does not include all provided options', function() {
let babelOptions = { blah: true };
this.addon.parent = {
options: {
babel: babelOptions,
},
};

let result = this.addon._getBabelOptions();
expect(result.blah).to.be.undefined;
});

it('does not mutate addonOptions.babel', function() {
let babelOptions = { blah: true };
this.addon.parent = {
Expand Down

0 comments on commit a6d01ff

Please sign in to comment.