Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rollup-plugin-typescript] declarationDir inside same directory as file option #1773

Open
mririgoyen opened this issue Sep 24, 2024 · 1 comment

Comments

@mririgoyen
Copy link

Perhaps related to #1772.

  • Rollup Plugin Name: rollup-plugin-typescript
  • Rollup Plugin Version: 12.1.0
  • Rollup Version: 4.22.4
  • Operating System (or Browser):
  • Node Version: 20.17

Expected Behavior

Nested sub-directories continue to be valid.

Actual Behavior

Based on the breaking change, output must be the same as the declaration directory. However, I believe this check is being over-zealous, disallowing sub-directories within the declaration directory.

After the v12 update, the following error is presented:

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

Additional Information

The declaration directory in tsconfig.json:

"declarationDir": "lib",

The rollup config:

  {
    input: 'src/tailwind/config.ts',
    output: [{ file: 'lib/tailwind/config.js', format: 'cjs' }],
    plugins: [
      typescript({
        filterRoot: 'src/tailwind',
      }),
    ],
  },

If I simplify the output to lib/config.js, the error is gone. However, my directory structure is no longer valid.

@shellscape
Copy link
Collaborator

shellscape commented Sep 24, 2024

We'd be happy to take a look at a Pull Request which resolves this condition, but one which keeps current tests passing.

(Please also note that moving forward, issues without a valid reproduction will be moved to a Q & A discussion. Those aren't optional, and the issue template mentions that a bunch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants