mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
build: tsup for better cjs / esm support
This commit is contained in:
35
tsup.config.js
Normal file
35
tsup.config.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import { defineConfig } from 'tsup';
|
||||
|
||||
export function createTsupConfig({
|
||||
entry = ['src/index.ts'],
|
||||
external = [],
|
||||
noExternal = [],
|
||||
platform = 'node',
|
||||
format = ['esm', 'cjs'],
|
||||
target = 'es2022',
|
||||
skipNodeModulesBundle = true,
|
||||
clean = true,
|
||||
shims = true,
|
||||
minify = false,
|
||||
splitting = false,
|
||||
keepNames = true,
|
||||
dts = true,
|
||||
sourcemap = true,
|
||||
} = {}) {
|
||||
return defineConfig({
|
||||
entry,
|
||||
external,
|
||||
noExternal,
|
||||
platform,
|
||||
format,
|
||||
skipNodeModulesBundle,
|
||||
target,
|
||||
clean,
|
||||
shims,
|
||||
minify,
|
||||
splitting,
|
||||
keepNames,
|
||||
dts,
|
||||
sourcemap,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user