Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c267b8d

Browse files
committed
Add a note about babel-plugin-rewire
See jhnns#62
1 parent a4fc3a8 commit c267b8d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ myModule.__set__("console", {
188188

189189
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.
190190

191+
**Transpiled ES6 modules**<br>
192+
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).
193+
194+
In this case you should use [babel-plugin-rewire](https://github.com/speedskater/babel-plugin-rewire) instead.
195+
191196
<br />
192197

193198
API

0 commit comments

Comments
 (0)