Fix issues to work with webpack

This commit is contained in:
Denis Izmaylov 2015-07-28 00:02:56 +03:00 committed by Trent Mick
parent bedb2ae7ff
commit 466829dc73

View file

@ -26,16 +26,26 @@ var xxx = function xxx(s) { // internal dev/debug logging
var xxx = function xxx() {}; // comment out to turn on debug logging var xxx = function xxx() {}; // comment out to turn on debug logging
var os = require('os'); if (typeof window === 'undefined') {
var fs = require('fs'); var os = require('os');
var util = require('util'); var fs = require('fs');
var assert = require('assert'); try {
try {
/* Use `+ ''` to hide this import from browserify. */ /* Use `+ ''` to hide this import from browserify. */
var dtrace = require('dtrace-provider' + ''); var dtrace = require('dtrace-provider' + '');
} catch (e) { } catch (e) {
dtrace = null; dtrace = null;
}
} else {
var os = {
hostname: function () {
return window.location.host;
}
};
var fs = {};
var dtrace = null;
} }
var util = require('util');
var assert = require('assert');
var EventEmitter = require('events').EventEmitter; var EventEmitter = require('events').EventEmitter;
try { try {