From 285d9324223d838228e0608e5069d478d20ddbf2 Mon Sep 17 00:00:00 2001 From: Solomon Cammack Date: Tue, 7 Feb 2023 03:57:47 +0000 Subject: [PATCH] Add rollup plugin to support "fs" module when on client --- website/package.json | 1 + website/vite.config.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/website/package.json b/website/package.json index 7fa3e96d..a665268f 100644 --- a/website/package.json +++ b/website/package.json @@ -18,6 +18,7 @@ "notyf": "^3.10.0", "obs-websocket-js": "^5.0.2", "opus-decoder": "^0.5.3", + "rollup-plugin-node-builtins": "^2.1.2", "socket.io-client": "^4.0.1", "spacetime": "^6.16.0", "spacetime-informal": "^0.6.1", diff --git a/website/vite.config.js b/website/vite.config.js index cad076d3..cde6de81 100644 --- a/website/vite.config.js +++ b/website/vite.config.js @@ -11,7 +11,8 @@ export default defineConfig({ plugins: [vue()], resolve: { alias: { - "@": fileURLToPath(new URL("./src", import.meta.url)) + "@": fileURLToPath(new URL("./src", import.meta.url)), + fs: require.resolve("rollup-plugin-node-builtins") }, extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"] }