I'm trying to write a loader that adds a derivative file to the webpack filesystem cache.
At a high level, I have a CSS loader that should generate TypeScript type definition files for the CSS classes. This loader lives in the middle of the loader order, since I'm generating these files for CSS modules.
I can write these files using fs
, but then the TypeScript loader does not see the files until the next time webpack is run. This makes TS throw errors the first time around.
How can I get the loader to modify webpack's filesystem cache?