babel-loader icon indicating copy to clipboard operation
babel-loader copied to clipboard

Expose cache implementation

Open Klemensas opened this issue 5 years ago • 0 comments

I'm submitting a feature request

Is there any possibility to expose the cache implementation as a direct export? Or as a separate package?

A form of this is already done in https://github.com/viankakrisna/loader-fs-cache but already seems to be somewhat out of sync with this version. It's used in eslint-loader as their caching mechanism.

Pulling it directly from here seems like a cleaner solution and I imagine there are multiple other packages that would like to use it.

I realize that there's a possibility to import it like import cache from 'babel-loader/lib/cache' but that seems iffy and could break easily.

If implementing it would most likely need to:

  • support customizing the default directory
  • support passing in a custom transform option https://github.com/babel/babel-loader/issues/832.

Klemensas avatar Mar 18 '20 14:03 Klemensas