This repository was archived by the owner on May 22, 2025. It is now read-only.
  
  
  
  
  
Description
Minimal reproduction follows:
test.ts
export module Foo {
    const notAnEmptyModule = 6;
}
 
Output: test.js
var Foo;
(function (Foo) {
    const /** @type {number} */ notAnEmptyModule = 6;
})(Foo = exports.Foo || (exports.Foo = {}));
 
Compiling with Closure Compiler v20180101 (the latest at the time of this writing) fails with this error:
vulcan/build/js/test.js:10: ERROR - Exports must be a statement at the top-level of a module
})(Foo = exports.Foo || (exports.Foo = {}));
                         ^^^^^^^^^^^^^^^^
 
As a workaround, doing the export on a separate line generates working code:
module Foo {
    const notAnEmptyModule = 6;
}
export {Foo};