Skip to content

Add basic webpack DLLPlugin support (experimental)

Mike Greiling requested to merge mg-introduce-webpack-dlls into master

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:

  1. Compile the vendor DLL with yarn webpack-vendor
  2. Run webpack-dev-server with WEBPACK_VENDOR_DLL=true (either add WEBPACK_VENDOR_DLL=true to your Procfile in the appropriate line, or run gdk stop webpack and run webpack manually with WEBPACK_VENDOR_DLL=true yarn dev-server)
  3. 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 or webpack.vendor.config.js
  • make WEBPACK_VENDOR_DLL=true the default behavior in GDK

Part of: #32152 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading