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 os = require('os');
|
||||
var fs = require('fs');
|
||||
var util = require('util');
|
||||
var assert = require('assert');
|
||||
try {
|
||||
if (typeof window === 'undefined') {
|
||||
var os = require('os');
|
||||
var fs = require('fs');
|
||||
try {
|
||||
/* Use `+ ''` to hide this import from browserify. */
|
||||
var dtrace = require('dtrace-provider' + '');
|
||||
} catch (e) {
|
||||
} catch (e) {
|
||||
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;
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue