Skip to content

Prevent webpack from rebooting while switching branches

Mike Greiling requested to merge fix-webpack-dynamic-entries into master

What does this MR do?

Uses webpack to watch for changes in automatic entry points rather than relying on nodemon to reboot the entire process when it detects changes.

This required an upstream bug fix in webpack-dev-server which the maintainer graciously merged over the weekend: https://github.com/webpack/webpack-dev-server/pull/1319

Are there points in the code the reviewer needs to double check?

You should be able to add or remove a file called index.js anywhere within app/assets/javascripts/pages/**/* and not cause webpack to reboot itself.

Why was this MR needed?

Any time a new automatic webpack entry point was added, removed, or even modified (usually when switching branches), webpack-dev-server would be rebooted to make sure it caught the changes. This could cause a full 30-60 second delay before it recompiles and you could load a page in the GDK again.

Screenshots (if relevant)

N/A

Does this MR meet the acceptance criteria?

  • Reviewed by Frontend

What are the relevant issue numbers?

Closes #43638 (closed) and #43418 (closed)

Related to #37792 (closed) and #41341 (closed)

Merge request reports