Skip to content

Commit db0ef36

Browse files
committed
Fix WASM chunking issue by copying to public directory as static assets
1 parent 8228dec commit db0ef36

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,27 @@ jobs:
5858
cd frontend
5959
npm run build
6060
61-
- name: Copy WASM files to multiple locations
61+
- name: Copy WASM files as static assets
6262
run: |
6363
echo "Current directory structure:"
6464
ls -la
6565
echo "PKG directory contents:"
6666
ls -la pkg/
6767
68-
# Copy to dist/pkg (for relative imports)
68+
# Copy WASM files to public directory so they're treated as static assets
69+
echo "Creating public/pkg directory:"
70+
mkdir -p frontend/public/pkg
71+
cp -r pkg/* frontend/public/pkg/
72+
73+
# Also copy to dist for backup
6974
echo "Creating dist/pkg directory:"
7075
mkdir -p frontend/dist/pkg
7176
cp -r pkg/* frontend/dist/pkg/
7277
73-
# Copy to dist root (for absolute imports)
74-
echo "Copying WASM files to dist root:"
75-
cp -r pkg/* frontend/dist/
76-
78+
echo "Verifying copied files in public/pkg:"
79+
ls -la frontend/public/pkg/
7780
echo "Verifying copied files in dist/pkg:"
7881
ls -la frontend/dist/pkg/
79-
echo "Verifying copied files in dist root:"
80-
ls -la frontend/dist/ | grep -E "(rust_wasm|\.wasm)"
8182
8283
echo "Final dist directory structure:"
8384
find frontend/dist -name "*.wasm" -o -name "rust_wasm.js" | head -10

frontend/vite.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export default defineConfig({
1717
}
1818
}
1919
},
20-
copyPublicDir: false,
2120
assetsInclude: ['**/*.wasm'],
2221
define: {
2322
// This ensures the base path is available at runtime

0 commit comments

Comments
 (0)