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

Skip to content

Commit 6ad592e

Browse files
committed
Merge pull request jhnns#84 from trodrigues/patch-1
Add a note about babel-plugin-rewire
2 parents 437c2e0 + c267b8d commit 6ad592e

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
@@ -191,6 +191,11 @@ myModule.__set__("console", {
191191

192192
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.
193193

194+
**Transpiled ES6 modules**<br>
195+
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).
196+
197+
In this case you should use [babel-plugin-rewire](https://github.com/speedskater/babel-plugin-rewire) instead.
198+
194199
<br />
195200

196201
API

0 commit comments

Comments
 (0)