Skip to content

Commit

Permalink
Add a note about babel-plugin-rewire
Browse files Browse the repository at this point in the history
  • Loading branch information
trodrigues committed Nov 20, 2015
1 parent a4fc3a8 commit c267b8d
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 @@ -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**<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 c267b8d

Please sign in to comment.