Skip to content

Emit adds generated code before file header/copyright comment #1526

@mjbvz

Description

@mjbvz

Steps to reproduce

Compile a ts file with a copyright comment:

/*---------------------------------------------------------------------------------------------
 *  Copyright
 *--------------------------------------------------------------------------------------------*/

export const a = 1;

Behavior with [email protected]

The generated helpers and module code is added after the comment:

"use strict";
/*---------------------------------------------------------------------------------------------
 *  Copyright
 *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
exports.a = 1;

Behavior with tsgo

The copyright comment after the added code:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
/*---------------------------------------------------------------------------------------------
 *  Copyright
 *--------------------------------------------------------------------------------------------*/
exports.a = 1;

Metadata

Metadata

Assignees

Labels

Domain: EmitRelated to emit, AST printing, Program emit funcs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions