fix: add wasm plugin to shell.js build for Automerge runtime
The shell now imports RSpaceOfflineRuntime which transitively pulls in Automerge WASM. Without the wasm() plugin and esnext target on the shell build step, vite fails with "ESM integration proposal for Wasm is not supported". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b2b5644f94
commit
741a519a30
|
|
@ -33,17 +33,20 @@ export default defineConfig({
|
|||
},
|
||||
});
|
||||
|
||||
// Build shell.ts as a standalone JS bundle
|
||||
// Build shell.ts as a standalone JS bundle (needs wasm() for Automerge via runtime)
|
||||
await build({
|
||||
configFile: false,
|
||||
root: resolve(__dirname, "website"),
|
||||
plugins: [wasm()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@lib": resolve(__dirname, "./lib"),
|
||||
"@shared": resolve(__dirname, "./shared"),
|
||||
'@automerge/automerge': resolve(__dirname, 'node_modules/@automerge/automerge'),
|
||||
},
|
||||
},
|
||||
build: {
|
||||
target: "esnext",
|
||||
emptyOutDir: false,
|
||||
outDir: resolve(__dirname, "dist"),
|
||||
lib: {
|
||||
|
|
@ -558,6 +561,33 @@ export default defineConfig({
|
|||
resolve(__dirname, "dist/modules/rnetwork/network.css"),
|
||||
);
|
||||
|
||||
// Build socials canvas component
|
||||
await build({
|
||||
configFile: false,
|
||||
root: resolve(__dirname, "modules/rsocials/components"),
|
||||
build: {
|
||||
emptyOutDir: false,
|
||||
outDir: resolve(__dirname, "dist/modules/rsocials"),
|
||||
lib: {
|
||||
entry: resolve(__dirname, "modules/rsocials/components/folk-socials-canvas.ts"),
|
||||
formats: ["es"],
|
||||
fileName: () => "folk-socials-canvas.js",
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: "folk-socials-canvas.js",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Copy socials canvas CSS
|
||||
mkdirSync(resolve(__dirname, "dist/modules/rsocials"), { recursive: true });
|
||||
copyFileSync(
|
||||
resolve(__dirname, "modules/rsocials/components/socials-canvas.css"),
|
||||
resolve(__dirname, "dist/modules/rsocials/socials-canvas.css"),
|
||||
);
|
||||
|
||||
// Build tube module component
|
||||
await build({
|
||||
configFile: false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue