Skip to content

Commit 1fad2e0

Browse files
committed
Simpler no-global for CommonJS.
We don’t need the index.js to unset the global if we don’t set it.
1 parent aa8605b commit 1fad2e0

5 files changed

Lines changed: 5 additions & 15 deletions

File tree

d3.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9499,6 +9499,5 @@
94999499
d3.xml = d3_xhrType(function(request) {
95009500
return request.responseXML;
95019501
});
9502-
if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
9503-
this.d3 = d3;
9502+
if (typeof define === "function" && define.amd) define(this.d3 = d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
95049503
}();

d3.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"type": "git",
2626
"url": "https://github.com/mbostock/d3.git"
2727
},
28-
"main": "index.js",
28+
"main": "d3.js",
2929
"browserify": "d3.js",
3030
"jspm": {
3131
"main": "d3",

src/end.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if (typeof define === "function" && define.amd) define(d3);
1+
if (typeof define === "function" && define.amd) define(this.d3 = d3);
22
else if (typeof module === "object" && module.exports) module.exports = d3;
3-
this.d3 = d3;
3+
else this.d3 = d3;
44
}();

0 commit comments

Comments
 (0)