Skip to content

Commit

Permalink
Merge pull request #38 from slamdata/module-require
Browse files Browse the repository at this point in the history
Use module.require to prevent bundling for browser
  • Loading branch information
jdegoes committed Aug 6, 2015
2 parents 125f9e7 + 1fca38b commit db63471
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"gulp-jscs": "^1.6.0",
"gulp-jshint": "^1.11.2",
"gulp-plumber": "^1.0.0",
"gulp-purescript": "^0.5.0",
"gulp-purescript": "^0.6.0",
"express": "^4.13.1",
"body-parser": "^1.13.2",
"xmlhttprequest": "^1.7.0"
Expand Down
5 changes: 2 additions & 3 deletions src/Network/HTTP/Affjax.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global exports */
/* global XMLHttpRequest */
/* global require */
/* global module */
"use strict";

Expand All @@ -12,12 +11,12 @@ exports._ajax = function (mkHeader, options, canceler, errback, callback) {
if (typeof module !== "undefined" && module.exports) {
// We are on node.js
platformSpecific.newXHR = function () {
var XHR = require("xmlhttprequest").XMLHttpRequest;
var XHR = module.require("xmlhttprequest").XMLHttpRequest;
return new XHR();
};

platformSpecific.fixupUrl = function (url) {
var urllib = require("url");
var urllib = module.require("url");
var u = urllib.parse(url);
u.protocol = u.protocol || "http:";
u.hostname = u.hostname || "localhost";
Expand Down

0 comments on commit db63471

Please sign in to comment.