Fix issues to work with webpack
This commit is contained in:
parent
bedb2ae7ff
commit
466829dc73
1 changed files with 16 additions and 6 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue