Polish @babel/node REPL (#12786)
This commit is contained in:
parent
c07185207c
commit
4b8a6a8e80
@ -213,13 +213,19 @@ function requireArgs() {
|
||||
}
|
||||
|
||||
function replStart() {
|
||||
repl.start({
|
||||
const replServer = repl.start({
|
||||
prompt: "babel > ",
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
eval: replEval,
|
||||
useGlobal: true,
|
||||
preview: true,
|
||||
});
|
||||
if (process.env.BABEL_8_BREAKING) {
|
||||
replServer.setupHistory(process.env.NODE_REPL_HISTORY, () => {});
|
||||
} else {
|
||||
replServer.setupHistory?.(process.env.NODE_REPL_HISTORY, () => {});
|
||||
}
|
||||
}
|
||||
|
||||
function replEval(code, context, filename, callback) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user