// tsup.config.ts import { defineConfig } from 'tsup' import fs from 'node:fs' import path from 'node:path' // --- 0) Atualiza package.json antes do build (determinístico) --- const pkgPath = path.resolve('package.json') const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) // Agora vamos de Day.js “turbinado”: CJS + ESM + IIFE const nextPkg = { ...pkg, main: 'dist/index.cjs', // Node / SSR (require) module: 'dist/index.mjs', // Bundlers ESM types: 'dist/index.d.ts', // Tipos browser: 'dist/index.global.js', // Browser sem bundler (