Expected Behaviour
For a project like this:
// bar.ts
export { IFoo , FOO } from "./foo" ;
export type IBar = { } ;
// foo.ts
export type IFoo = { } ;
export const FOO = 1 ;
// index.ts
import { FOO , IFoo , IBar } from "./bar" ;
declare function foo ( i : number ) : IFoo ;
declare function bar ( ) : IBar ;
foo ( FOO ) ;
bar ( ) ;
Regardless of whether transpileOnly is enabled, the output for bar.ts should be (assuming module=ESNEXT):
Actual Behaviour
The actual output is:
export { IFoo } from "./foo" ;
export var FOO = 1 ;
which causes webpack to complain:
WARNING in ./src/bar.ts
1:0-34 "export 'IFoo' was not found in './foo'
@ ./src/bar.ts
@ ./src/index.ts
When transpileOnly is off, the module is correctly emitted. This may very well be a compiler bug, but I'm not sure how to use tsc to reproduce this.
Steps to Reproduce the Problem
git clone https://github.com/univerio/ts-loader-type-export-issue
cd ts-loader-type-export-issue
yarn
./node_modules/webpack-cli/bin/webpack.js
Location of a Minimal Repository that Demonstrates the Issue.
https://github.com/univerio/ts-loader-type-export-issue
👍 React with 👍 13MCluck90, bradenhs, tehbi4, skovy, pdfrod and 8 more ❤️ React with ❤️ 2miracle2k and pdfrod