Created
September 4, 2020 00:48
-
-
Save ricokahler/200685b7da2920442bc1a795fcf7137f to your computer and use it in GitHub Desktop.
register function
This file contains hidden or 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 path = require('path'); | |
require('@babel/register')({ extensions: ['.js', '.ts', '.tsx'] }); | |
const args = process.argv.slice(2); | |
if (args[0] === '--') { | |
const filename = args[1]; | |
// require relative to the root | |
require(path.resolve(__dirname, '../', filename)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment