Created
September 11, 2017 16:42
-
-
Save zpao/f4a6e9647abda48928cffb90b0ef5e50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["./.babelrc.js"], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fbjsMM = require('fbjs/module-map') | |
const myMM = Object.assign({}, fbjsMM, { | |
'./original': './rewritten', | |
}); | |
module.exports = { | |
"plugins": [ | |
["babel-preset-fbjs/plugins/rewrite-modules", { | |
map: myMM, | |
prefix: '', | |
}] | |
], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./original'); | |
// fbjs module | |
const invariant = require('invariant'); | |
invariant(false, 'hello world'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('original') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('rewritten') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment