Skip to content

Commit 33f9593

Browse files
committed
Copy actual manifest files from webpack build if they exist
Instead of always creating empty stub manifest files, try to copy the actual files from the Pro dummy webpack build first. This ensures RSC tests have proper module mappings when the webpack build successfully generates them. Falls back to empty stubs if the files don't exist, preserving the hang-prevention behavior.
1 parent a94d26a commit 33f9593

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/react-on-rails-pro-node-renderer/scripts/setup-test-env.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,19 @@ mkdir -p "$ROOT_DUMMY/public/webpack/test"
2626
echo "Copying bundles to test locations..."
2727
cp "$PRO_DUMMY/ssr-generated"/*.js "$ROOT_DUMMY/ssr-generated/"
2828

29-
# Create stub manifest files
30-
echo "Creating stub manifest files..."
31-
echo "{}" > "$ROOT_DUMMY/public/webpack/test/react-client-manifest.json"
32-
echo "{}" > "$ROOT_DUMMY/ssr-generated/react-server-client-manifest.json"
29+
# Copy or create manifest files
30+
echo "Copying manifest files..."
31+
if [ -f "$PRO_DUMMY/public/webpack/test/react-client-manifest.json" ]; then
32+
cp "$PRO_DUMMY/public/webpack/test/react-client-manifest.json" "$ROOT_DUMMY/public/webpack/test/"
33+
else
34+
echo "{}" > "$ROOT_DUMMY/public/webpack/test/react-client-manifest.json"
35+
fi
36+
37+
if [ -f "$PRO_DUMMY/ssr-generated/react-server-client-manifest.json" ]; then
38+
cp "$PRO_DUMMY/ssr-generated/react-server-client-manifest.json" "$ROOT_DUMMY/ssr-generated/"
39+
else
40+
echo "{}" > "$ROOT_DUMMY/ssr-generated/react-server-client-manifest.json"
41+
fi
3342

3443
echo "✓ Test environment setup complete!"
3544
echo ""

0 commit comments

Comments
 (0)