Skip to content

acutmore/transpile-module-bug

Repository files navigation

$ npx tsc -v
Version 5.1.3

Bug description: Exports removed when using tsc.transpileModule, verbatimModuleSyntax: false and export identifier overlaps with type.

Input file:

// exports.ts

import fooValue from "./values";
import type {Foo} from "./types";

const Foo: Foo = fooValue as any as Foo;

export {Foo};

Project compile:

$ npm run compile

> compile
> tsc -p tsconfig.json

Result:

// exports.js
import fooValue from "./values";
var Foo = fooValue;
export { Foo }; // export preserved

transpileModule:

$ npm run transpile

> transpile
> node transpile.mjs

Result:

// exports.transpile.js

import fooValue from "./values";
var Foo = fooValue;

// exports missing

About

Example for issue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published