Open frank-dspeed opened 4 years ago
// We need a separate import to run code before the UMD module evaluates
import './my-module-setup.js';
// load the UMD module, which will populate window.exports
import './my-module.umd.js';
//export the UMD exports
export default let exports = window.exports;
// cleanup
window.exports = undefined;
Custom Shim The custom shim works the same, but uses individual exports. This would likely be generated:
my-module.js:
// We need a separate import to run code before the UMD module evaluates
import './my-module-setup.js';
// load the UMD module, which will populate window.exports
import './my-module.umd.js';
//export the UMD exports
export const a = window.exports.a;
export const b = window.exports.b;
// cleanup
window.exports = undefined;
ideas from umd