-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.js
More file actions
27 lines (26 loc) · 820 Bytes
/
Copy pathvite.config.js
File metadata and controls
27 lines (26 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { fileURLToPath } from "node:url";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { defineConfig } from "vite";
import { appDefines } from "./vite.shared.js";
const customElement =
process.env.CUSTOM_ELEMENT !== "0" && process.env.CUSTOM_ELEMENT !== "false";
// https://vitejs.dev/config/
export default defineConfig({
define: appDefines,
optimizeDeps: {
entries: ["index.html", "tests/e2e/*.html"],
},
build: {
outDir: fileURLToPath(
new URL(`./dist/${customElement ? "wc" : "svelte"}`, import.meta.url)
),
lib: {
entry: fileURLToPath(new URL("./src/main.ts", import.meta.url)),
cssFileName: "style",
fileName: (format) => `svelte-aplayer.${format}.js`,
formats: ["es", "umd"],
name: "Aplayer",
},
},
plugins: [svelte()],
});