From cb691d477803e92154e579fee1f58aae1e5a59dc Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Jul 2023 06:45:30 -0400 Subject: [PATCH] ci: copy node vite config from main vite config --- ui/vite.config.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ui/vite.config.js b/ui/vite.config.js index 23013f5..3d7f1de 100644 --- a/ui/vite.config.js +++ b/ui/vite.config.js @@ -1,10 +1,11 @@ import { defineConfig } from "vite"; import { svelte } from "@sveltejs/vite-plugin-svelte"; import { resolve } from "path"; +import optimizer from "vite-plugin-optimizer"; +import { nodePolyfills } from "vite-plugin-node-polyfills"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [svelte()], build: { rollupOptions: { input: { @@ -13,5 +14,20 @@ export default defineConfig({ dashboard: resolve(__dirname, "dashboard.html"), }, }, + minify: false, }, + resolve: { + dedupe: ["@lumeweb/libportal", "@lumeweb/libweb", "@lumeweb/libkernel"], + }, + plugins: [ + svelte(), + optimizer({ + "node-fetch": + "const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};", + }), + nodePolyfills({ + exclude: ["fs"], + globals: { Buffer: true, global: true, process: true }, + }), + ], });