From c267b8d8da52efdd54a9fa12ac85e0bcee94c20d Mon Sep 17 00:00:00 2001 From: Tiago Rodrigues Date: Fri, 20 Nov 2015 15:46:04 +0100 Subject: [PATCH] Add a note about babel-plugin-rewire See #62 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 2e1a89a..8fe92a4 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,11 @@ myModule.__set__("console", { This replaces `console` just inside `myModule`. That is, because rewire is using `eval()` to turn the key expression into an assignment. Hence, calling `myModule.__set__("console.log", fn)` modifies the `log` function on the *global* `console` object. +**Transpiled ES6 modules**
+If you are using Babel with ES6 rewire does not know how to mock the top level references in a module because Babel has remapped them (see #62). + +In this case you should use [babel-plugin-rewire](https://github.com/speedskater/babel-plugin-rewire) instead. +
API