forked from rlemaigre/vue3-promise-dialog
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite-lib.config.ts
40 lines (36 loc) · 863 Bytes
/
vite-lib.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
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import dts from "vite-plugin-dts";
import pkg from "./package.json";
const path = require("path");
// On reprend le nom du module à partir de package.json :
const name = pkg.name;
// On reprend toutes les dépendances à externaliser de package.json :
const external = Object.keys(
{ ...pkg.dependencies, ...pkg.peerDependencies } || {}
);
export default defineConfig({
base: "",
server: {
port: 8080,
},
plugins: [
vue(),
dts({
skipDiagnostics: true,
include: ["lib/**/*", "lib/components/*"],
}),
],
build: {
lib: {
entry: path.resolve(__dirname, "lib/index.ts"),
name,
formats: ["es"],
fileName: (format) => name + `.${format}.js`,
},
rollupOptions: {
external,
output: {},
},
},
});