make webpack over 9000 times better (#1816)

* webpack stuff

* even better

* Update browser.js
This commit is contained in:
Crawl
2017-08-22 19:57:59 +02:00
parent 0b22d9a774
commit a85fc91630
5 changed files with 18 additions and 7 deletions

View File

@@ -1,5 +1,4 @@
const os = require('os');
const EventEmitter = require('events').EventEmitter;
const EventEmitter = require('events');
const Constants = require('../util/Constants');
const Permissions = require('../util/Permissions');
const Util = require('../util/Util');
@@ -250,7 +249,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

@@ -61,5 +61,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