bsouthga / typescript-emit-bug-2

Home Page:https://github.com/Microsoft/TypeScript/issues/23065

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript emit issue

Tested on versions

  • 2.7.2
  • 2.8.1
  • next

Repro

  • install deps (npm install)
  • run test (npm test)
  • take a look at ./dist/b.js

Description

Given a.js and b.js as follows:

// a.js
const Obj = {};
export default Obj;
// b.js
import Obj from './a';

Obj.fn = function() {};

The following emit is produced for b.js -- missing the import of Obj and resulting in a runtime error:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
Obj.fn = function () { };
//# sourceMappingURL=b.js.map

About

https://github.com/Microsoft/TypeScript/issues/23065


Languages

Language:JavaScript 100.0%