aurelia / polyfills

The minimal set of polyfills needed to run Aurelia.
MIT License
26 stars 27 forks source link

Karma getting stuck on aurelia-polyfills import with TS 2.3+ #56

Closed gronostajo closed 6 years ago

gronostajo commented 6 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: When aurelia-polyfills is imported and TypeScript version is at least 2.3.0, Karma will infinitely get stuck before first test. Minimal example: https://github.com/gronostajo/aurelia-polyfills-bug

Expected/desired behavior:

Tests should run and complete, as with TS 2.2 or without `aurelia-polyfills`.
gronostajo commented 6 years ago

I was to eager to blame aurelia-polyfills. Beginning with TS2.3, System.JS is detecting typescript.js as an ES module (this regex matches because the string ; export const is present in typescript.js) and attempts to transpile it. To make it work up to TS2.6, one must explicitly specify module format and exports in Karma config:

systemjs: {
  meta: {
    "typescript": {
      format: 'global',
      exports: 'ts',
    }
  },
},