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