Commit 1fad2e0c authored by Mike Bostock's avatar Mike Bostock

Simpler no-global for CommonJS.

We don’t need the index.js to unset the global if we don’t set it.
parent aa8605bf
......@@ -9499,6 +9499,5 @@
d3.xml = d3_xhrType(function(request) {
return request.responseXML;
});
if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
this.d3 = d3;
if (typeof define === "function" && define.amd) define(this.d3 = d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
}();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
var globals = {};
// Stash old global.
if ("d3" in global) globals.d3 = global.d3;
module.exports = require("./d3");
// Restore old global.
if ("d3" in globals) global.d3 = globals.d3; else delete global.d3;
......@@ -25,7 +25,7 @@
"type": "git",
"url": "https://github.com/mbostock/d3.git"
},
"main": "index.js",
"main": "d3.js",
"browserify": "d3.js",
"jspm": {
"main": "d3",
......
if (typeof define === "function" && define.amd) define(d3);
if (typeof define === "function" && define.amd) define(this.d3 = d3);
else if (typeof module === "object" && module.exports) module.exports = d3;
this.d3 = d3;
else this.d3 = d3;
}();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment