diff options
author | Marko Žarković <marko@kastela.com> | 2018-01-24 19:34:05 +0300 |
---|---|---|
committer | Marko Žarković <marko@kastela.com> | 2018-01-24 19:34:05 +0300 |
commit | 122689eac737b9d20a39314990647780e726765f (patch) | |
tree | 1d5d6c8d291e139b0cc7bbb04d9d4b6daa298396 /lib | |
parent | 18c5d0e09ef0f6cf666d664fbbf74435e190f23c (diff) |
Add support for object spread/rest operator.
Before this commit, using rewire on a module that had object spread/rest
operator in it would throw an exception. Now it doesn't.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/moduleEnv.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/moduleEnv.js b/lib/moduleEnv.js index a9f410a..cbd5e25 100644 --- a/lib/moduleEnv.js +++ b/lib/moduleEnv.js @@ -76,7 +76,10 @@ function jsExtension(module, filename) { module._compile = function (content, filename) { content = babelCore.transform(content, { - plugins: [require.resolve("babel-plugin-transform-es2015-block-scoping")], + plugins: [ + require.resolve("babel-plugin-transform-es2015-block-scoping"), + require.resolve("babel-plugin-transform-object-rest-spread") + ], retainLines: true, filename: filename, babelrc: false |