dreamonkey / responsive-image-plugin

A webpack plugin to automagically bring your website images to a whole new level of responsiveness!
MIT License
7 stars 0 forks source link

Performance optimization #6

Open IlCallo opened 4 years ago

IlCallo commented 4 years ago
IlCallo commented 4 years ago
IlCallo commented 3 years ago

We should use cache-loader to avoid repeating processing for older images. Unluckily, emitted files aren't cached: https://github.com/webpack-contrib/cache-loader/issues/99 There is an unmerged solving PR: https://github.com/webpack-contrib/cache-loader/pull/109

Since the package is deprecated (Webpack 5 manages cache natively), we should fork the project, apply the PR and re-publish it under our scope

IlCallo commented 2 years ago

Since the package is deprecated (Webpack 5 manages cache natively), we should fork the project, apply the PR and re-publish it under our scope

We bumped a new minor version which support webpack 5 only and added a section to leverage the built-in cache system instead

IlCallo commented 2 years ago

Transformation into a plugin broke native cache support, as we're not emitting files from the loader anymore with emitFile, but with emitAsset into the plugin, so they're not taken into consideration when running a subsequent build using the cache. We need to re-enable it