2023-07-17 11:25:53 +00:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
|
|
import { resolve } from "path";
|
2023-07-18 10:45:30 +00:00
|
|
|
import optimizer from "vite-plugin-optimizer";
|
|
|
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
2023-07-25 15:53:12 +00:00
|
|
|
import autoPreprocess from "svelte-preprocess";
|
2023-07-17 11:25:53 +00:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
|
|
|
input: {
|
|
|
|
onboarding: resolve(__dirname, "onboarding.html"),
|
|
|
|
account: resolve(__dirname, "account.html"),
|
|
|
|
dashboard: resolve(__dirname, "dashboard.html"),
|
|
|
|
},
|
|
|
|
},
|
2023-07-18 10:45:30 +00:00
|
|
|
minify: false,
|
2023-07-17 11:25:53 +00:00
|
|
|
},
|
2023-07-18 10:45:30 +00:00
|
|
|
resolve: {
|
|
|
|
dedupe: ["@lumeweb/libportal", "@lumeweb/libweb", "@lumeweb/libkernel"],
|
|
|
|
},
|
|
|
|
plugins: [
|
2023-07-25 15:53:12 +00:00
|
|
|
svelte({
|
|
|
|
preprocess: autoPreprocess(),
|
|
|
|
}),
|
2023-07-18 10:45:30 +00:00
|
|
|
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 },
|
|
|
|
}),
|
|
|
|
],
|
2023-07-17 11:25:53 +00:00
|
|
|
});
|