diff --git a/src/wrapper/start.frag b/src/wrapper/start.frag index e2032d6..30306e8 100644 --- a/src/wrapper/start.frag +++ b/src/wrapper/start.frag @@ -1,10 +1,12 @@ (function(global, factory) { "use strict"; - if (typeof global.define === "function" && global.define.amd) { + if (typeof define === "function" && define.amd) { define(["d3"], function(d3) { factory(global, d3); }); + } else if (typeof require === "function") { + factory(global, require("d3")); } else { factory(global, global.d3); }