Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarko Žarković <marko@kastela.com>2018-01-24 19:34:05 +0300
committerMarko Žarković <marko@kastela.com>2018-01-24 19:34:05 +0300
commit122689eac737b9d20a39314990647780e726765f (patch)
tree1d5d6c8d291e139b0cc7bbb04d9d4b6daa298396 /lib
parent18c5d0e09ef0f6cf666d664fbbf74435e190f23c (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.js5
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