Skip to content

Instantly share code, notes, and snippets.

@tech4him1
Created September 18, 2018 15:28
Show Gist options
  • Save tech4him1/525da39ffdda45a566bd885ad14a6570 to your computer and use it in GitHub Desktop.
Save tech4him1/525da39ffdda45a566bd885ad14a6570 to your computer and use it in GitHub Desktop.
UMD differences between rollup and webpack
function webpack(global, factory) {
if (typeof exports === "object" && typeof module === "object") {
module.exports = factory();
} else if (typeof define === "function" && define.amd) {
define("netlify-cms", [], factory);
} else if (typeof exports === "object") {
exports["netlify-cms"] = factory();
} else {
global["netlify-cms"] = factory();
}
}
function rollup(global, factory) {
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = factory();
} else if (typeof define === "function" && define.amd) {
define(factory);
} else {
global["netlify-cms"] = factory();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment