-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
41 lines (39 loc) · 1.04 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
import path from "path";
import { defineConfig, normalizePath } from "vite";
import rollupLicensePlugin from "rollup-plugin-license";
import typescriptPlugin from "vite-plugin-typescript";
import dtsBundleGeneratorPlugin from "vite-plugin-dts-bundle-generator";
export default defineConfig({
define: {},
build: {
lib: {
entry: normalizePath(path.resolve(__dirname, "src", "index.ts")),
name: "polymatic",
fileName: "polymatic",
formats: ["es", "umd"],
},
minify: false,
sourcemap: true,
},
plugins: [
rollupLicensePlugin({
sourcemap: true,
banner: getLicense(),
}),
typescriptPlugin({
}),
dtsBundleGeneratorPlugin({
fileName: "polymatic.d.ts",
}),
],
});
function getLicense() {
const version = process.env.npm_package_version;
const year = new Date().getFullYear();
const license = `
Polymatic v${version ?? "?"}
@copyright Copyright ${year} Ali Shakiba
@license Licensed under the MIT (https://github.com/piqnt/polymatic/blob/main/LICENSE.md)
`;
return license;
}