plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[rollup-plugin-typescript] Re-enable declarationDir outside output file/dir

Open marekdedic opened this issue 1 year ago • 11 comments

  • Rollup Plugin Name: rollup-plugin-typescript
  • Rollup Plugin Version: 12.1.0
  • Rollup Version: 4.22.4
  • Operating System (or Browser): Ubuntu 22.04
  • Node Version: 22.9.0
  • Link to reproduction: marekdedic/rollup-plugin-htaccess/pull/121

Expected Behavior

Enable declarationDir to be outside the rollup output directory, much like it was possible in v11

Actual Behavior

Since v12, I get:

[!] (plugin typescript) RollupError: [plugin typescript] @rollup/plugin-typescript: Path of Typescript compiler option 'declarationDir' must be located inside the same directory as the Rollup 'file' option.

Additional Information

The change I'd like to be reconsidered was introduced in #1728. However, emitting declarations to a different place from the build output can be really useful for things like post-processing with api-extractor - having the intermediary declarations produced by rollup be outside the final output dir makes it much easier to not accidentally include these files in the final build.

marekdedic avatar Sep 23 '24 20:09 marekdedic