diff --git a/tsdown.config.ts b/tsdown.config.ts index 844df06..cb46fd6 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -1,15 +1,33 @@ import { defineConfig } from 'tsdown' -export default defineConfig({ +const shared = { entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - globalName: 'abstractionkit', - dts: true, - clean: true, sourcemap: false, target: 'es2022', - deps: { neverBundle: ['ethers'] }, - outputOptions: { - globals: { ethers: 'ethers' }, +} as const + +export default defineConfig([ + // Node / bundler builds (CJS + ESM). @noble/* stay external so npm consumers + // resolve and dedupe a single copy from node_modules. + { + ...shared, + format: ['cjs', 'esm'], + dts: true, + clean: true, + }, + // Browser / CDN build (IIFE, the `unpkg` entry). A