Skip to content

Commit 4dbc15d

Browse files
committed
Rename --build to --emit
1 parent 6045a24 commit 4dbc15d

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ _Environment variable denoted in parentheses._
143143
* `--pretty` Use pretty diagnostic formatter (`TS_NODE_PRETTY`, default: `false`)
144144
* `--skip-project` Skip project config resolution and loading (`TS_NODE_SKIP_PROJECT`, default: `false`)
145145
* `--skip-ignore` Skip ignore checks (`TS_NODE_SKIP_IGNORE`, default: `false`)
146-
* `--build` Emit output files into `.ts-node` directory (`TS_NODE_BUILD`, default: `false`)
146+
* `--emit` Emit output files into `.ts-node` directory (`TS_NODE_EMIT`, default: `false`)
147147
* `--prefer-ts-exts` Re-order file extensions so that TypeScript imports are preferred (`TS_NODE_PREFER_TS_EXTS`, default: `false`)
148148
* `--log-error` Logs TypeScript errors to stderr instead of throwing exceptions (`TS_NODE_LOG_ERROR`, default: `false`)
149149

src/bin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function main (argv: string[]) {
5858
'--skip-ignore': Boolean,
5959
'--prefer-ts-exts': Boolean,
6060
'--log-error': Boolean,
61-
'--build': Boolean,
61+
'--emit': Boolean,
6262

6363
// Aliases.
6464
'-e': '--eval',
@@ -68,7 +68,6 @@ export function main (argv: string[]) {
6868
'-h': '--help',
6969
'-s': '--script-mode',
7070
'-v': '--version',
71-
'-B': '--build',
7271
'-T': '--transpile-only',
7372
'-I': '--ignore',
7473
'-P': '--project',
@@ -101,7 +100,7 @@ export function main (argv: string[]) {
101100
'--skip-ignore': skipIgnore = DEFAULTS.skipIgnore,
102101
'--prefer-ts-exts': preferTsExts = DEFAULTS.preferTsExts,
103102
'--log-error': logError = DEFAULTS.logError,
104-
'--build': build = DEFAULTS.build
103+
'--emit': emit = DEFAULTS.emit
105104
} = args
106105

107106
if (help) {
@@ -152,6 +151,7 @@ export function main (argv: string[]) {
152151
// Register the TypeScript compiler instance.
153152
const service = register({
154153
dir: getCwd(dir, scriptMode, scriptPath),
154+
emit,
155155
files,
156156
pretty,
157157
transpileOnly,

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const VERSION = require('../package.json').version
7373
*/
7474
export interface CreateOptions {
7575
dir?: string
76-
build?: boolean | null
76+
emit?: boolean | null
7777
scope?: boolean | null
7878
pretty?: boolean | null
7979
transpileOnly?: boolean | null
@@ -121,7 +121,7 @@ export interface TypeInfo {
121121
*/
122122
export const DEFAULTS: RegisterOptions = {
123123
dir: process.env.TS_NODE_DIR,
124-
build: yn(process.env.TS_NODE_BUILD),
124+
emit: yn(process.env.TS_NODE_EMIT),
125125
scope: yn(process.env.TS_NODE_SCOPE),
126126
files: yn(process.env.TS_NODE_FILES),
127127
pretty: yn(process.env.TS_NODE_PRETTY),
@@ -421,7 +421,7 @@ export function create (options: CreateOptions = {}): Register {
421421
output[0] = file
422422
}
423423

424-
if (options.build) sys.writeFile(path, file, writeByteOrderMark)
424+
if (options.emit) sys.writeFile(path, file, writeByteOrderMark)
425425
}, undefined, undefined, getCustomTransformers())
426426

427427
if (result.emitSkipped) {
@@ -467,7 +467,7 @@ export function create (options: CreateOptions = {}): Register {
467467
}
468468

469469
// Write `.tsbuildinfo` when `--build` is enabled.
470-
if (options.build && config.options.incremental) {
470+
if (options.emit && config.options.incremental) {
471471
process.on('exit', () => {
472472
// Emits `.tsbuildinfo` to filesystem.
473473
(builderProgram.getProgram() as any).emitBuildInfo()

0 commit comments

Comments
 (0)