Skip to content

Commit 949c0a3

Browse files
committed
fix: make bb.js work on server
1 parent 5a2d2ae commit 949c0a3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/interface/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"scripts": {
77
"dev": "pnpm _chore && vite dev --port 5193",
8-
"build": "pnpm _chore && pnpm test:lint && vite build",
8+
"build": "pnpm _chore && pnpm test:lint && vite build --ssr",
99
"preview": "vite preview",
1010
"test": "pnpm test:lint && pnpm test:unit",
1111
"test:unit": "pnpm _chore && vitest run",

apps/interface/vite.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { sveltekit } from "@sveltejs/kit/vite";
22
import fs from "node:fs";
33
import path from "node:path";
44
import copy from "rollup-plugin-copy";
5-
import { defineConfig, type Plugin, type UserConfig } from "vite";
5+
import { defineConfig, type Plugin } from "vite";
66
import resolve from "vite-plugin-resolve";
77

8-
export default defineConfig({
8+
export default defineConfig((configEnv) => ({
99
plugins: [
1010
sveltekit(),
1111
copy({
@@ -18,7 +18,7 @@ export default defineConfig({
1818
wasmContentTypePlugin(),
1919
resolve({
2020
util: `export const inspect = {}`,
21-
...(process.env.NODE_ENV === "production"
21+
...(process.env.NODE_ENV === "production" && !configEnv.isSsrBuild
2222
? {
2323
// `unreachable` error in wasm is caused by incorrect version of bb.js. Consult pnpm-lock.yaml
2424
"@aztec/bb.js": `export * from "https://unpkg.com/@aztec/[email protected]/dest/browser/index.js"`,
@@ -39,7 +39,7 @@ export default defineConfig({
3939
testTimeout: 99999999,
4040
teardownTimeout: 99999999,
4141
},
42-
} satisfies UserConfig);
42+
}));
4343

4444
function wasmContentTypePlugin(): Plugin {
4545
return {

0 commit comments

Comments
 (0)