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

Why not use the default cache directory (node_modules/.cache/rollup-plugin-typescript2)? #328

Closed
agilgur5 opened this issue Nov 14, 2019 · 0 comments · Fixed by #329
Closed

Comments

@agilgur5
Copy link
Collaborator

agilgur5 commented Nov 14, 2019

Current Behavior

Currently tsdx outputs to ./.rts2_cache_* and requires you to have a gitignore for these directories.

Desired Behavior

Use rollup-plugin-typescript2's default, which is node_modules/.cache/rollup-plugin-typescript2. This way there's no need to gitignore anything extra (as node_modules is usually gitignored already) and it doesn't clutter up the app root with more gitignored directories. babel-loader has a similar default directory in node_modules/.cache/babel-loader, but it doesn't let you change the directory.

Suggested Solution

Remove the cacheRoot configuration of rollup-plugin-typescript2 on

cacheRoot: `./.rts2_cache_${opts.format}`,
. Alternatively, use node_modules/.cache/rollup-plugin-typescript2_${opts.format} so it retains the cache suffix, but isn't located externally.

This would also mean the default gitignores no longer need these directories.

EDIT: see #329 for an implementation of this suggested solution.

Who does this impact? Who is this for?

All users, but it shifts the cache into entirely internal.

Describe alternatives you've considered

Added an alternative in suggested solutions.

Additional context

See rollup-plugin-typescript2 and babel-loader links above.

I'm not sure what the original rationale / explanation for having the cache be outside of node_modules/.cache/ and different from the default cacheRoot was. I couldn't find any rationale in any comments, issues, PRs, or in the commit description of the commit that added this config, so I don't know what the reasoning behind that was. It also didn't seem like that option was carried over in #208 (it doesn't seem like rollup-plugin-ts has that option though), but it was brought back in the rollback #287.

I think it would be useful to at least elaborate on that here as that was a somewhat consequential decision.

@agilgur5 agilgur5 changed the title Why not use default cache directory (node_modules/.cache/rollup-plugin-typescript2)? Why not use the default cache directory (node_modules/.cache/rollup-plugin-typescript2)? Nov 14, 2019
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

Successfully merging a pull request may close this issue.

1 participant