Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add local babel workflow * update README
- Loading branch information
1 parent
87976f5
commit 63bad42
Showing
4 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const path = require('path'); | ||
|
||
const babelPath = process.env.BABEL_PATH ? | ||
path.resolve(process.cwd(), process.env.BABEL_PATH) : | ||
undefined; | ||
|
||
module.exports = function contextualizeRequire(path) { | ||
if (!babelPath) { | ||
return require(path); | ||
} | ||
const newPath = `${babelPath}/${path.replace('@babel/', 'packages/babel-')}`; | ||
return require(newPath); | ||
}; |
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
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