Skip to content

Commit 194c847

Browse files
author
Kelly Selden
authored
Merge pull request #224 from twokul/fix
Fix presets array bug
2 parents fcc6c89 + 18c751d commit 194c847

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ module.exports = {
223223

224224
options.presets = [
225225
shouldRunPresetEnv && this._getPresetEnvPlugins(addonProvidedConfig),
226-
]
226+
].filter(Boolean);
227227

228228
if (shouldCompileModules) {
229229
options.moduleIds = true;

node-tests/addon-test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,24 @@ describe('ember-cli-babel', function() {
791791
expect(result.plugins).to.deep.include(plugin);
792792
});
793793

794+
it('sets `presets` to empty array if `disablePresetEnv` is true', function() {
795+
let options = {
796+
'ember-cli-babel': {
797+
disablePresetEnv: true,
798+
}
799+
};
800+
this.addon.parent = {
801+
options: {
802+
babel6: {
803+
plugins: [ {} ]
804+
},
805+
},
806+
};
807+
808+
let result = this.addon.buildBabelOptions(options);
809+
expect(result.presets).to.deep.equal([]);
810+
});
811+
794812
it('user plugins are before preset-env plugins', function() {
795813
let plugin = function Plugin() {};
796814
this.addon.parent = {

0 commit comments

Comments
 (0)