From 122689eac737b9d20a39314990647780e726765f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20=C5=BDarkovi=C4=87?= Date: Wed, 24 Jan 2018 17:34:05 +0100 Subject: 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. --- lib/moduleEnv.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/moduleEnv.js') 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 -- cgit v1.2.3