strothj / react-docgen-typescript-loader

Webpack loader to generate docgen information from Typescript React components.
Other
360 stars 47 forks source link

Reduce synchronous file IO #112

Open uselessinfo opened 4 years ago

uselessinfo commented 4 years ago

This change switches the initial loading of TypeScript into memory from synchronous to asynchronous, and avoids using fs.existsSync in the Service Host if we already have the file in memory.

For most setups this probably won't make much of a difference, but my project runs in Docker Desktop for Mac, which has a long standing issue with slow, CPU-intensive file IO in mounted folders, so it is necessary to keep build times reasonable. Moving to async for most of the filesystem operations keeps Webpack from pausing each time this loader is invoked.