mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
make webpack over 9000 times better (#1816)
* webpack stuff * even better * Update browser.js
This commit is contained in:
9
browser.js
Normal file
9
browser.js
Normal 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!');
|
||||
Reference in New Issue
Block a user