mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
feat(ESModules): importing for esm modules (#3998)
* fix: importing for esm modules * style: use single quotes * refactor: remove 'use strict'
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -18,6 +18,7 @@ deploy/deploy_key.pub
|
|||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
.tmp/
|
.tmp/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.idea/
|
||||||
docs/docs.json
|
docs/docs.json
|
||||||
typings/index.js
|
typings/index.js
|
||||||
webpack/
|
webpack/
|
||||||
|
|||||||
89
esm/discord.mjs
Normal file
89
esm/discord.mjs
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
import Discord from '../src/index.js';
|
||||||
|
|
||||||
|
export default Discord;
|
||||||
|
|
||||||
|
export const {
|
||||||
|
BaseClient,
|
||||||
|
Client,
|
||||||
|
Shard,
|
||||||
|
ShardClientUtil,
|
||||||
|
ShardingManager,
|
||||||
|
WebhookClient,
|
||||||
|
ActivityFlags,
|
||||||
|
BitField,
|
||||||
|
Collection,
|
||||||
|
Constants,
|
||||||
|
DataResolver,
|
||||||
|
BaseManager,
|
||||||
|
DiscordAPIError,
|
||||||
|
HTTPError,
|
||||||
|
MessageFlags,
|
||||||
|
Intents,
|
||||||
|
Permissions,
|
||||||
|
Speaking,
|
||||||
|
Snowflake,
|
||||||
|
SnowflakeUtil,
|
||||||
|
Structures,
|
||||||
|
SystemChannelFlags,
|
||||||
|
Util,
|
||||||
|
version,
|
||||||
|
ChannelManager,
|
||||||
|
GuildChannelManager,
|
||||||
|
GuildEmojiManager,
|
||||||
|
GuildEmojiRoleManager,
|
||||||
|
GuildMemberManager,
|
||||||
|
GuildMemberRoleManager,
|
||||||
|
GuildManager,
|
||||||
|
ReactionUserManager,
|
||||||
|
MessageManager,
|
||||||
|
PresenceManager,
|
||||||
|
RoleManager,
|
||||||
|
UserManager,
|
||||||
|
discordSort,
|
||||||
|
escapeMarkdown,
|
||||||
|
fetchRecommendedShards,
|
||||||
|
resolveColor,
|
||||||
|
resolveString,
|
||||||
|
splitMessage,
|
||||||
|
Base,
|
||||||
|
Activity,
|
||||||
|
APIMessage,
|
||||||
|
CategoryChannel,
|
||||||
|
Channel,
|
||||||
|
ClientApplication,
|
||||||
|
ClientUser,
|
||||||
|
Collector,
|
||||||
|
DMChannel,
|
||||||
|
Emoji,
|
||||||
|
Guild,
|
||||||
|
GuildAuditLogs,
|
||||||
|
GuildChannel,
|
||||||
|
GuildEmoji,
|
||||||
|
GuildMember,
|
||||||
|
Integration,
|
||||||
|
Invite,
|
||||||
|
Message,
|
||||||
|
MessageAttachment,
|
||||||
|
MessageCollector,
|
||||||
|
MessageEmbed,
|
||||||
|
MessageMentions,
|
||||||
|
MessageReaction,
|
||||||
|
NewsChannel,
|
||||||
|
PermissionOverwrites,
|
||||||
|
Presence,
|
||||||
|
ClientPresence,
|
||||||
|
ReactionCollector,
|
||||||
|
ReactionEmoji,
|
||||||
|
RichPresenceAssets,
|
||||||
|
Role,
|
||||||
|
StoreChannel,
|
||||||
|
Team,
|
||||||
|
TeamMember,
|
||||||
|
TextChannel,
|
||||||
|
User,
|
||||||
|
VoiceChannel,
|
||||||
|
VoiceRegion,
|
||||||
|
VoiceState,
|
||||||
|
Webhook,
|
||||||
|
WebSocket
|
||||||
|
} = Discord;
|
||||||
10
package.json
10
package.json
@@ -4,6 +4,16 @@
|
|||||||
"description": "A powerful library for interacting with the Discord API",
|
"description": "A powerful library for interacting with the Discord API",
|
||||||
"main": "./src/index",
|
"main": "./src/index",
|
||||||
"types": "./typings/index.d.ts",
|
"types": "./typings/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": [
|
||||||
|
{
|
||||||
|
"require": "./src/index.js",
|
||||||
|
"import": "./esm/discord.mjs"
|
||||||
|
},
|
||||||
|
"./src/index.js"
|
||||||
|
],
|
||||||
|
"./esm": "./esm/discord.mjs"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run lint && npm run docs:test && npm run lint:typings",
|
"test": "npm run lint && npm run docs:test && npm run lint:typings",
|
||||||
"test:typescript": "tsc",
|
"test:typescript": "tsc",
|
||||||
|
|||||||
Reference in New Issue
Block a user