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

Plug-in applies incorrectly to .d.ts/.d.mts files #36

Open
sentience opened this issue Sep 18, 2023 · 0 comments
Open

Plug-in applies incorrectly to .d.ts/.d.mts files #36

sentience opened this issue Sep 18, 2023 · 0 comments

Comments

@sentience
Copy link

sentience commented Sep 18, 2023

When this plugin is added to Rollup and Rollup is configured to emit .d.ts/.d.mts type declaration files, the build may fail due to an apparent race between the creation of the declaration files on disk and the invocation of chmod to set their executable flag to +x. Unless I'm mistaken, we don't need to make these type declaration files executable anyway, so the best fix would probably just be to exclude these files.

Additionally, this plug-in is preserving the shebang line in .d.ts/.d.mts files, causing it to produce type declaration files like this:

#!/usr/bin/env node

Without this plug-in, those same type declaration files contain this:

export { }

In short, rollup-plugin-hashbang should ignore .d.(m)ts files generated by Rollup.

See also downstream issue egoist/tsup#1001

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

1 participant