From c97ce30c2ea64e791dcb7384229bef669befeb50 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 12 Jul 2023 04:46:26 -0400 Subject: [PATCH] ci: add vite.config.js as an actual file --- vite.config.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) mode change 120000 => 100644 vite.config.js diff --git a/vite.config.js b/vite.config.js deleted file mode 120000 index 3c7efd5..0000000 --- a/vite.config.js +++ /dev/null @@ -1 +0,0 @@ -node_modules/presetter/generated/@lumeweb/kernel-discovery-irc/vite.config.js \ No newline at end of file diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..a6c9b86 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,30 @@ +import { defineConfig } from "vite"; +import optimizer from "vite-plugin-optimizer"; +import inject from "@rollup/plugin-inject"; + +export default defineConfig({ + build: { + outDir: "lib", + lib: { + entry: "build/index.js", + name: "main", + formats: ["cjs"], + fileName: "index", + }, + minify: false, + rollupOptions: { output: { inlineDynamicImports: true } }, + }, + resolve: { + dedupe: ["@lumeweb/libportal", "@lumeweb/libweb", "@lumeweb/libkernel"], + alias: { tls: "./build/net.js", net: "./build/net.js" }, + }, + plugins: [ + optimizer({ + "node-fetch": + "const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};", + }), + inject({ + Buffer: ["buffer", "Buffer"], + }), + ], +});