pim-community-dev icon indicating copy to clipboard operation
pim-community-dev copied to clipboard

RAB-UNIV: Use cache mode in development mode in order to improve build performance

Open StevenVAIDIE opened this issue 1 year ago • 0 comments

Description (for Contributor and Core Developer)

Since webpack 5.0, we have the possibility to use cache in order to improve the time used by webpack to build the front cf: article

In this PR:

  • I activate the cache in dev and deactivate it in production mode (as preconized on official documentation: https://webpack.js.org/configuration/cache/#cache)
  • I also removed the usage of webpack.WatchIgnorePlugin as it's deprecated now (https://webpack.js.org/plugins/watch-ignore-plugin/) => replaced by watchOptions.ignored
  • I also configured the managedPaths because actually all akeneo workspace are not included into the hash calculation so for webpack if I change src/Akeneo/Platform/Bundle/UIBundle/Resources/workspaces/system/src/components/SystemIndex.tsx for example, the generated vendor.js is the same. Default value is /^(.+?[\\/]node_modules[\\/]) that why we need to redifine it. We already have the problem when we do a webpack-watch => webpack recompile but change are not included, now it's not anymore the case.

Performance analysis:

project with cache without cache
EE 79.27s 18.28s
CE 60.56s 13.42s

For now, the cache is not stored in the CI, let's see if it work well before doing it

Definition Of Done (for Core Developer only)

  • [ ] Tests
  • [ ] Migration & Installer
  • [ ] PM Validation (Story)
  • [ ] Changelog (maintenance bug fixes)
  • [ ] Tech Doc

StevenVAIDIE avatar May 30 '23 17:05 StevenVAIDIE