Prevent rollup from renaming Promise to Promise$1

Viewed 1388

Update: Turned out that this is not a problem with Babel, but with Rollup, which is run before. Thanks for your help anyway and sorry for the noise.

I use rollup to bundle a number of modules including a Promise polyfill (deliberately overwriting the global Promise). However, rollup recognizes Promise as a global name and transforms

export default function Promise(fn) { ... }
...
global.Promise = Promise;

to

function Promise$1(fn) { ... }
...
global.Promise = Promise$1;

The resulting code works, but I would like the following assertion to hold true:

expect(Promise.name).to.equal('Promise');

Is there any way to tell rollup to leave the constructor name intact?

1 Answers
Related