`"terser"` minify provokes error
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
### Code causing the error
```ts
import { build } from "tsup";
const run = async (outDir: string) => {
await build({
outDir,
minify: "terser",
entry: ["src/index.ts"],
sourcemap: false,
clean: false,
target: "es5",
dts: false,
format: "iife",
platform: "browser",
globalName: "test",
});
};
run('build');
```
### Error text
```
undefined:1
��z��
^
SyntaxError: Unexpected token in JSON at position 0
at JSON.parse ()
at new AnyMap (/{some-path}/marker-cluster/node_modules/@jridgewell/src/any-map.ts:20:37)
at mapSourcePosition (/{some-path}/marker-cluster/node_modules/@cspotcode/source-map-support/source-map-support.js:387:14)
at wrapCallSite (/{some-path}/marker-cluster/node_modules/@cspotcode/source-map-support/source-map-support.js:592:20)
at Function.prepareStackTrace (/{some-path}/marker-cluster/node_modules/@cspotcode/source-map-support/source-map-support.js:671:41)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at getErrorSource (/{some-path}/marker-cluster/node_modules/@cspotcode/source-map-support/source-map-support.js:681:64)
at printFatalErrorUponExit (/{some-path}/marker-cluster/node_modules/@cspotcode/source-map-support/source-map-support.js:714:16)
at process.emit.sharedData.processEmitHook.installedValue [as emit] (/{some-path}/marker-cluster/node_modules/@cspotcode/source-map-support/source-map-support.js:753:9)
```
Contributor guide
Assessment
This issue has not been assessed yet.