-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
43 lines (40 loc) · 1.07 KB
/
vite.config.ts
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import Vue from "@vitejs/plugin-vue";
import mkcert from "vite-plugin-mkcert";
import { resolve } from "node:path";
// https://vitejs.dev/config/
export default defineConfig({
server: {
https: true,
},
plugins: [
mkcert({
savePath: ".mkcert/",
autoUpgrade: true,
}),
Vue({ style: { filename: "style.css" } }),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
lib: {
// Set the entry point (file that contains our components exported).
entry: resolve(__dirname, "src/index.ts"),
// Name of the library.
name: "vue3-quagga2",
// We are building for CJS and ESM, use a function to rename automatically files.
// Example: my-component-library.esm.js
fileName: (format) => `${"vue3-quagga2"}.${format}.js`,
},
rollupOptions: {
// Vue is provided by the parent project, don't compile Vue source-code inside our library.
external: ["vue"],
output: { globals: { vue: "Vue" } },
},
sourcemap: true,
},
});