Skip to content

Commit

Permalink
Merge pull request #84 from trodrigues/patch-1
Browse files Browse the repository at this point in the history
Add a note about babel-plugin-rewire
  • Loading branch information
jhnns committed Mar 15, 2016
2 parents 437c2e0 + c267b8d commit 6ad592e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,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**<br>
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.

<br />

API
Expand Down

0 comments on commit 6ad592e

Please sign in to comment.