-
-
Notifications
You must be signed in to change notification settings - Fork 664
/
vite.config.js
33 lines (33 loc) · 1.13 KB
/
vite.config.js
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
const path = require("path");
const { defineConfig } = require("vite");
import Banner from "vite-plugin-banner";
import pkg from "./package.json";
import friendlyTypeImports from "rollup-plugin-friendly-type-imports";
import { resolve } from "path";
module.exports = defineConfig({
base: "./",
build: {
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "Kalidokit",
fileName: (format) => `kalidokit.${format}.js`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
exports: "named",
external: [],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {},
},
},
},
plugins: [
Banner(
`/**\n * @${pkg.name} v${pkg.version}\n * ${pkg.description}\n * \n * @license\n * Copyright (c) ${pkg.year} ${pkg.author}\n * SPDX-License-Idntifier: ${pkg.license} \n * ${pkg.homepage}\n */`
),
friendlyTypeImports(),
],
});