From ed532af7f7a2c825690752fa3d1233e4a140536d Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Fri, 5 May 2023 22:52:24 -0500 Subject: [PATCH] revert: multiplatform --- tsup.config.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tsup.config.js b/tsup.config.js index 665b3cb..7f7afbb 100644 --- a/tsup.config.js +++ b/tsup.config.js @@ -3,10 +3,15 @@ import { writeFile } from 'fs/promises'; import ifdefPlugin from 'esbuild-ifdef'; const shared = { entry: ['src/index.ts'], - external: ['discord.js'], + external: ['discord.js', 'iti'], platform: 'node', clean: true, sourcemap: false, + treeshake: { + moduleSideEffects: false, + correctVarValueBeforeDeclaration: true, //need this to treeshake esm discord.js empty import + annotations: true, + }, }; export default defineConfig([ { @@ -14,8 +19,10 @@ export default defineConfig([ target: 'node16', tsconfig: './tsconfig-esm.json', outDir: './dist/esm', - treeshake: true, - esbuildPlugins: [ifdefPlugin({ variables: { MODE: 'esm' }, verbose: true })], + splitting: false, + esbuildPlugins: [ + ifdefPlugin({ variables: { MODE: 'esm' }, verbose: true }), + ], outExtension() { return { js: '.mjs',