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

(change): use node_modules/.cache/... as cacheRoot #329

Merged
merged 1 commit into from
Dec 3, 2019

Conversation

agilgur5
Copy link
Collaborator

@agilgur5 agilgur5 commented Nov 14, 2019

  • instead of outputting these to app root and requiring users to
    gitignore these directories, just output to node_modules/.cache/
    • rollup-plugin-typescript2 is the default cache directory [1], so this
      initially appended _${opts.format} to it
      • upon code review, changed it to tsdx/${opts.format}/
      • babel-loader similarly uses node_modules/.cache/babel-loader [2]
        as its default cache directory and does not allow users to
        change it
        • parcel uses node_modules/.cache/parcel too [3]
        • fuse-box uses node_modules/.fusebox [4]

[1]: https://github.com/ezolenko/rollup-plugin-typescript2#plugin-options > cacheRoot
[2]: https://github.com/babel/babel-loader#options > cacheDirectory
[3]: https://github.com/parcel-bundler/parcel#caching
[4]: https://github.com/fuse-box/fuse-box/blob/master/docs/getting-started/get-started.md#caching


Fixes #328 . Not sure if this change makes sense as, per the issue, I don't know / couldn't find the rationale for using the app root .rts2_cache_* directories. I'm also not sure if just removing the cacheRoot option and using the default may cause issues -- I'm assuming the ${opts.format} is there because it does, so I left it in while moving the cache into node_modules.

Feel free to close if this doesn't make sense, #328 is more of a question, but I figure I might as well make the small changes I suggested for it in case it does.

src/createRollupConfig.ts Outdated Show resolved Hide resolved
@agilgur5
Copy link
Collaborator Author

Tested this with my fork and it creates the new directories successfully and starts caching there with no problems (as far as I can tell at least) 👍

- instead of outputting these to app root and requiring users to
  gitignore these directories, just output to node_modules/.cache/
  - rollup-plugin-typescript2 is the default cache directory, so this
    initially appended _${opts.format} to it
    - upon code review, changed it to tsdx/${opts.format}/
    - babel-loader similarly uses node_modules/.cache/babel-loader
      as its default cache directory and does not allow users to
      change it
      - parcel uses node_modules/.cache/parcel too
      - fuse-box uses node_modules/.fusebox
@jaredpalmer jaredpalmer merged commit 55c0d47 into jaredpalmer:master Dec 3, 2019
sebald added a commit to sebald/tsdx that referenced this pull request Dec 19, 2019
* master: (26 commits)
  (deps/lint): upgrade @typescript-eslint to support ?. and ?? (jaredpalmer#377)
  (ci): add a lint job so PRs will require passing lint (jaredpalmer#378)
  (clean): remove .rts_cache_* from storybook gitignore (jaredpalmer#375)
  Add optional chaining and nullish coalescing operators support (jaredpalmer#370)
  Added Storybook template (jaredpalmer#318)
  (fix/ci): GitHub Actions should run on PRs as well
  (fix/format): formatting of jaredpalmer#366 didn't pass lint
  Add prepare script to generated project (jaredpalmer#334)
  default jest to watch mode when not in CI (jaredpalmer#366)
  (fix): respect tsconfig esModuleInterop flag (jaredpalmer#327)
  fix: minor typo
  update rollup deps and plugins
  update to ts 3.7
  Remove unnecessary yarn install command in GH action
  update README.md
  update README.md
  Use node_modules/.cache/... as cacheRoot (jaredpalmer#329)
  fix(lint): Only default to src test if they exist (jaredpalmer#344)
  Fix error when providing babel/preset-env without options (jaredpalmer#350)
  Replaced some sync methods for their async version
  ...
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 this pull request may close these issues.

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