Mateusz Krzeszowiak 9 years ago
parent
commit
57a3c574f6
  1. 2
      src/finalisers/iife.js
  2. 2
      src/finalisers/umd.js

2
src/finalisers/iife.js

@ -31,7 +31,7 @@ export default function iife ( bundle, magicString, { exportMode, indentString }
}
if ( exportMode === 'named' ) {
dependencies.unshift( `(this.${name} = {})` );
dependencies.unshift( `(this.${name} = this.${name} || {})` );
args.unshift( 'exports' );
}

2
src/finalisers/umd.js

@ -31,7 +31,7 @@ export default function umd ( bundle, magicString, { exportMode, indentString },
if ( exportMode === 'named' ) {
amdDeps.unshift( `'exports'` );
cjsDeps.unshift( `exports` );
globalDeps.unshift( `(${setupNamespace(options.moduleName)} = {})` );
globalDeps.unshift( `(${setupNamespace(options.moduleName)} = global.${options.moduleName} || {})` );
args.unshift( 'exports' );
}

Loading…
Cancel
Save