rollup-plugin-swc icon indicating copy to clipboard operation
rollup-plugin-swc copied to clipboard

Relative `baseUrl` path in `tsconfig.json` causes `base_dir(...) must be absolute` error

Open Phryxia opened this issue 1 year ago • 0 comments

  • Note that in tsconfig.json, baseUrl can be relative path. #reference
  • To reproduce, please checkout this repository.
    • It contains minimal reproduction files.
    • If you comment out baseUrl in tsconfig.json, npm run build will emit bundle.js
    • If you contain baseUrl in tsconfig.json, npm run build will cause errors like following:
> [email protected] build
> rollup --config rollup.config.js


index.ts → bundle.js...
thread '<unnamed>' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_transforms_module-0.179.5/src/path.rs:122:13:
base_dir(`./src`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly.

Phryxia avatar Jan 30 '24 14:01 Phryxia