1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/packages/next/build/output/clearConsole.ts
Joe Haddad 56b1f81ace Fix development mode output (#6312)
* Remove usage of WebpackBar and Friendly Errors

* Add new clearConsole helper

* Add new simplified output for development mode

* Add an explicit bootstrapping mode

* Add missing returns

* Use existing output style

* Adjust first output to say Waiting on

* Only print URL if present
2019-02-16 17:09:49 +01:00

14 lines
405 B
TypeScript

// This file is derived from Jest:
// https://github.com/facebook/jest/blob/d9d501ac342212b8a58ddb23a31518beb7b56f47/packages/jest-util/src/specialChars.ts#L18
const isWindows = process.platform === 'win32'
const isInteractive = process.stdout.isTTY
export function clearConsole() {
if (!isInteractive) {
return
}
process.stdout.write(isWindows ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H')
}