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

9
browser.js Normal file
View File

@@ -0,0 +1,9 @@
const browser = typeof window !== 'undefined';
const webpack = !!process.env.__DISCORD_WEBPACK__;
const Discord = require('./');
module.exports = Discord;
if (browser && webpack) window.Discord = Discord; // eslint-disable-line no-undef
// eslint-disable-next-line no-console
else if (!browser) console.warn('Warning: Attempting to use browser version of Discord.js in a non-browser environment!');