Skip to content

Commit

Permalink
fix: remove sourcemap comments on min build
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Oct 25, 2024
1 parent f15fb5a commit 4aedca9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineConfig } from "tsup";

import mangleCache from "./mangle-cache.json";

const minify = Boolean(process.env.MINIFY);

export default defineConfig({
entry: ["src/index.ts"],
format: ["cjs", "esm"],
Expand All @@ -10,8 +12,8 @@ export default defineConfig({
treeshake: true,
dts: true,
splitting: false,
sourcemap: true,
minify: Boolean(process.env.MINIFY),
sourcemap: !minify,
minify,
esbuildOptions: options => {
options.sourcesContent = false;
options.mangleProps = /[^_]_$/;
Expand Down

0 comments on commit 4aedca9

Please sign in to comment.