egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.49k stars 209 forks source link

I have a problem #1019

Open linktomarkdown opened 9 months ago

linktomarkdown commented 9 months ago

Hello, I'm sorry to bother you, I have a problem, I want to package the ES6 syntax and then remove the arrow function to convert it to work in browsers, I configured the target to es5, but the arrow function is still not converted!

Upvote & Fund

Fund with Polar

linktomarkdown commented 9 months ago

`import { defineConfig } from "tsup";

export default defineConfig({ entry: ["src/index.ts"], format: ["cjs", "esm"], // Build for commonJS and ESmodules dts: true, // Generate declaration file (.d.ts) splitting: false, sourcemap: false, clean: true, minify: 'terser', target: "es2020", platform: "browser", terserOptions: { ecma: 5, compress: { drop_console: true, }, ie8: true, }, });`