Add basic webpack DLLPlugin support (experimental)
What does this MR do?
Adds the ability to compile a batch of vendor libraries as a DLL for webpack to consume. These libraries are then served from disk rather than from memory so the dev-server memory requirements should be reduced.
Instructions for use:
- Compile the vendor DLL with
yarn webpack-vendor
- Run webpack-dev-server with
WEBPACK_VENDOR_DLL=true
(either addWEBPACK_VENDOR_DLL=true
to your Procfile in the appropriate line, or rungdk stop webpack
and run webpack manually withWEBPACK_VENDOR_DLL=true yarn dev-server
) - Open up a page on your GDK and observe that the script tags in the headers include a path that looks like
/assets/webpack/dll.c8d91fc5/vendor.dll.bundle.js
.
Everything should still work as normal, and the dev-server process should be a bit less memory hungry. Any changes to node_modules will require you to re-run the above three steps.
What still needs to be done (follow-up):
- create script to clean up old compiled vendor DLLs (FIFO policy by date)
- update CI process to use the vendor DLL and cache the results between pipelines
- make dev-server process automatically restart itself when changes are made to
yarn.lock
orwebpack.vendor.config.js
- make
WEBPACK_VENDOR_DLL=true
the default behavior in GDK
Part of: #32152 (closed)
Edited by 🤖 GitLab Bot 🤖