-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.mjs
45 lines (43 loc) · 1.14 KB
/
rollup.config.mjs
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
44
45
import dts from "rollup-plugin-dts";
const currentDate = new Date(),
options = { year: "numeric", month: "long", day: "numeric" },
formattedDate = currentDate.toLocaleDateString("en-US", options),
banner = `/**
* Dynamic Colors from KPVERSE
*
* v1.1.5
*
* Updated on ${formattedDate}.
*
* Copyright © 2023-present, Kartavya Patel. All rights reserved.
*
* @author Kartavya Patel <[email protected]>
*
* @license {@link https://github.com/patelka2211/dynamic-colors/blob/main/LICENSE MIT}
*/`;
export default [
process.env.format === "esm" && {
input: "./lib/index.js",
output: {
file: "index.js",
format: "es",
banner: `${banner}'use strict';`,
},
},
process.env.format === "esm" && {
input: "./src/index.ts",
output: {
file: "index.d.ts",
format: "es",
},
plugins: [dts()],
},
process.env.format === "iife" && {
input: "./build.iife.js",
output: {
file: "./DynamicColors.js",
format: "iife",
banner: banner,
},
},
].filter(Boolean);