-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.mjs
50 lines (48 loc) · 1.29 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
46
47
48
49
50
import dts from "rollup-plugin-dts";
const currentDate = new Date(),
options = { year: "numeric", month: "long", day: "numeric" },
formattedDate = currentDate.toLocaleDateString("en-US", options),
banner = `/**
* Sharer from KPVERSE
*
* v1.0.0
*
* Updated on ${formattedDate}.
*
* Copyright © 2023-present, Kartavya Patel. All rights reserved.
*
* @author Kartavya Patel <[email protected]>
*
* @license {@link https://github.com/patelka2211/sharer/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: "./Sharer.js",
format: "iife",
banner: banner,
globals: {
"@patelka2211/dominar": "Dominar",
"dynamic-colors": "DynamicColors",
html2canvas: "html2canvas",
},
},
},
].filter(Boolean);