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

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!');