pim-community-dev
pim-community-dev copied to clipboard
RAB-UNIV: Use cache mode in development mode in order to improve build performance
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 bywatchOptions.ignored
- I also configured the
managedPaths
because actually all akeneo workspace are not included into the hash calculation so for webpack if I changesrc/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