**Description:**
https://github.com/getsentry/rust-sourcemap/pull/91 should fix this
issue, but let's revert #9052 for now.
# Context
`swc_core` regressed.
Caught by https://github.com/vercel/next.js/pull/66902
```
⚠ Linting is disabled.
▲ Next.js 15.0.0-canary.34
✓ Checking validity of types
Creating an optimized production build ...
Panic: PanicInfo { payload: Any { .. }, message: Some(attempt to add with overflow), location: Location { file: "/Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sourcemap-8.0.1/src/encoder.rs", line: 89, col: 13 }, can_unwind: true, force_no_backtrace: false }
Backtrace: 0: backtrace::backtrace::libunwind::trace
at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/libunwind.rs:93:5
backtrace::backtrace::trace_unsynchronized::<<backtrace::capture::Backtrace>::create::{closure#0}>
at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:66:5
backtrace::backtrace::trace::<<backtrace::capture::Backtrace>::create::{closure#0}>
at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:53:14
<backtrace::capture::Backtrace>::create
at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:176:9
<backtrace::capture::Backtrace>::new
at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:140:22
1: next_swc_napi::init::{closure#0}
at packages/next-swc/crates/napi/src/lib.rs:85:29
2: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at /rustc/6f3df08aadf71e8d4bf7e49f5dc10dfa6f254cb4/library/alloc/src/boxed.rs:2077:9
std::panicking::rust_panic_with_hook
at /rustc/6f3df08aadf71e8d4bf7e49f5dc10dfa6f254cb4/library/std/src/panicking.rs:799:13
3: std::panicking::begin_panic_handler::{{closure}}
at /rustc/6f3df08aadf71e8d4bf7e49f5dc10dfa6f254cb4/library/std/src/panicking.rs
```
**Description:**
`dbg!()` output on ASTs is kinda verbose,
```rs
ExprStmt {
span: Span {
lo: BytePos(
37,
),
hi: BytePos(
50,
),
ctxt: #0,
},
expr: Lit(
Str(
Str {
span: Span {
lo: BytePos(
37,
),
hi: BytePos(
49,
),
ctxt: #0,
},
value: "use strict",
raw: Some(
"\"use strict\"",
),
},
),
),
}
```
A lot of the space is wasted on spans — 9 lines per span, even though
it's pretty much unimportant cruft. This PR changes that to just one
line per span:
```rs
ExprStmt {
span: 37..50#0,
expr: Lit(
Str(
Str {
span: 37..49#0,
value: "use strict",
raw: Some(
"\"use strict\"",
),
},
),
),
}
```
While not a statistically meaningful measurement, in my tests (sample
size = 1) this change reduces the `dbg!()` of a 1103-byte script from
5597 to 2885 lines, which is a 48% reduction. In `{:?}` mode it goes
from 40034 to 25457 chars, or 37% reduction.
**Description:**
- This PR fixes the source map generation when `inputSourceMap` is specified.
- This PR fixes `minify()` not accepting parsed source map in the option.
**Related issue:**
- Closes#8372.