diff --git a/packages/commonjs/README.md b/packages/commonjs/README.md index f2803e530..3024b1e43 100644 --- a/packages/commonjs/README.md +++ b/packages/commonjs/README.md @@ -299,7 +299,18 @@ For these situations, you can change Rollup's behaviour either globally or per m import * as dep$1 from 'dep'; function getAugmentedNamespace(n) { - var a = Object.defineProperty({}, '__esModule', { value: true }); + if (n.__esModule) return n; + var f = n.default; + if (typeof f == 'function') { + var a = function a() { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', { value: true }); Object.keys(n).forEach(function (k) { var d = Object.getOwnPropertyDescriptor(n, k); Object.defineProperty(