make webpack over 9000 times better (#1816)

* webpack stuff

* even better

* Update browser.js
This commit is contained in:
Gus Caplan
2017-08-22 10:55:28 -07:00
committed by Crawl
parent 4520c801d3
commit b055dae998
5 changed files with 17 additions and 6 deletions

View File

@@ -1,4 +1,3 @@
const os = require('os');
const EventEmitter = require('events');
const Constants = require('../util/Constants');
const Permissions = require('../util/Permissions');
@@ -265,7 +264,7 @@ class Client extends EventEmitter {
* @readonly
*/
get browser() {
return os.platform() === 'browser';
return typeof window !== 'undefined';
}
/**

View File

@@ -1,4 +1,4 @@
const browser = require('os').platform() === 'browser';
const browser = typeof window !== 'undefined';
const EventEmitter = require('events');
const Constants = require('../../util/Constants');
const zlib = require('zlib');

View File

@@ -57,5 +57,3 @@ module.exports = {
VoiceChannel: require('./structures/VoiceChannel'),
Webhook: require('./structures/Webhook'),
};
if (require('os').platform() === 'browser') window.Discord = module.exports; // eslint-disable-line no-undef