kernel-discovery-irc/vite.config.js

35 lines
824 B
JavaScript
Raw Normal View History

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"],
2023-07-12 11:05:14 +00:00
alias: {
tls: "./build/net.js",
net: "./build/net.js",
chardet: "@lumeweb/chardet",
},
},
plugins: [
optimizer({
"node-fetch":
"const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};",
}),
inject({
Buffer: ["buffer", "Buffer"],
}),
],
});