stealjs / steal-tools

Build easy. Load fast.
https://stealjs.com/docs/steal-tools.html
MIT License
67 stars 23 forks source link

tree shaking ignoring aliased import #1111

Open m-mujica opened 5 years ago

m-mujica commented 5 years ago

I have a moduleA like:

import  * as foo  from './moduleB';

where moduleB looks like:

export { default as bar } from 'moduleC';
export { default as baz } from 'moduleD';

Steal tree shaking logic is treating moduleB as dead code, transpiling it to an empty module:

...
System.register([], function (_export, _context) {
  "use strict";
  return {
    setters: [],
    execute: function () {
      _export("__esModule", true);
    }
  };
...