From 8cd9e941489c098ffb9a929f0865095962efba21 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 13 Jan 2026 14:06:15 +1100 Subject: [PATCH] Use a separate config for webpacker on CI For some reason having webpack compile turned on for the test environment makes system test slow, resulting in lots of failure. Assets are precompiled for system test, so there isn't any compilation on each request, but still test are slow. To fix the issue, we use a separate config file for CI where webpack compile is set turned off. --- .github/workflows/build.yml | 1 + config/ci_webpacker.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 config/ci_webpacker.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6711bb01a..d76df41de0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,6 +148,7 @@ jobs: - name: Run tests env: + WEBPACKER_CONFIG: "config/ci_webpacker.yml" KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ff2456e64c9f2aa5157eb0daf711d3c3 KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} diff --git a/config/ci_webpacker.yml b/config/ci_webpacker.yml new file mode 100644 index 0000000000..425e975f13 --- /dev/null +++ b/config/ci_webpacker.yml @@ -0,0 +1,34 @@ +# Note: You must restart bin/webpack-dev-server for changes to take effect + +default: &default + source_path: app/webpacker + source_entry_path: packs + public_root_path: public + public_output_path: packs + cache_path: tmp/cache/webpacker + webpack_compile_output: true + + # Additional paths webpack should look up modules + # ['app/assets', 'engine/foo/app/assets'] + additional_paths: [ + 'vendor', + 'app/webpacker/css', + 'app/webpacker/fonts', + 'app/webpacker/images', + 'engines/web/app/assets/stylesheets', + 'app/components' + ] + + # Reload manifest.json on all requests so we reload latest compiled packs + cache_manifest: false + + # Extract and emit a css file + extract_css: true + +test: + <<: *default + # Asset are precomiled on CI, so no need to compile here + compile: false + + # Compile test packs to a separate directory + public_output_path: packs-test