Skip to content

Commit

Permalink
Make sure we add the transformer too
Browse files Browse the repository at this point in the history
  • Loading branch information
arv committed Aug 10, 2018
1 parent 59194ac commit 3ecb57c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/transforms/babel.js
Expand Up @@ -265,6 +265,14 @@ async function getEnvPlugins(targets, useBuiltIns = false) {
{},
{targets, modules: false, useBuiltIns: useBuiltIns ? 'entry' : false}
).plugins;

// babel-preset-env version 6.x does not cover object-rest-spread so always
// add it.
plugins.push([
require('babel-plugin-transform-object-rest-spread'),
{useBuiltIns}
]);

envCache.set(key, plugins);
return plugins;
}
Expand Down
4 changes: 3 additions & 1 deletion test/javascript.js
Expand Up @@ -29,7 +29,9 @@ describe('javascript', function() {
});

it('should produce a basic JS bundle with object rest spread support', async function() {
let b = await bundle(__dirname + '/integration/object-rest-spread/object-rest-spread.js');
let b = await bundle(
__dirname + '/integration/object-rest-spread/object-rest-spread.js'
);

assert.equal(b.assets.size, 1);

Expand Down

0 comments on commit 3ecb57c

Please sign in to comment.