forked from gitbrent/bootstrap4-toggle
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrollup.config.js
More file actions
88 lines (82 loc) · 1.93 KB
/
Copy pathrollup.config.js
File metadata and controls
88 lines (82 loc) · 1.93 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import terser from "@rollup/plugin-terser";
import dts from "rollup-plugin-dts";
import { bannerContent } from "./scripts/package-banner.js";
const banner = `/*
* ${bannerContent.replaceAll("\n", "\n * ")}
*/`;
const umdECMAS = {
input: "src/main/js/index.ecmas.js",
output: [
{
file: "js/bootstrap5-toggle.ecmas.js",
format: "umd",
sourcemap: true,
banner,
},
{
file: "js/bootstrap5-toggle.ecmas.min.js",
format: "umd",
sourcemap: true,
plugins: [terser()],
banner,
},
],
};
const umdJquery = {
input: "src/main/js/index.jquery.js",
external: ["jquery"],
output: [
{
file: "js/bootstrap5-toggle.jquery.js",
format: "umd",
sourcemap: true,
globals: {
jquery: "jQuery",
},
banner,
},
{
file: "js/bootstrap5-toggle.jquery.min.js",
format: "umd",
sourcemap: true,
globals: {
jquery: "jQuery",
},
plugins: [terser()],
banner,
},
],
};
const mainConfig = {
input: "src/main/js/index.js",
output: [
{
file: "dist/bootstrap5-toggle.cjs",
format: "cjs",
sourcemap: true,
plugins: [terser()],
banner,
},
{
file: "dist/bootstrap5-toggle.mjs",
format: "es",
sourcemap: true,
plugins: [terser()],
banner,
},
],
};
const typesConfig = {
input: "dist/tmp/@types/index.d.ts",
output: {
file: "dist/bootstrap5-toggle.d.ts",
format: "es",
banner,
},
plugins: [
dts({
respectExternal: true,
}),
],
};
export default [umdECMAS, umdJquery, mainConfig, typesConfig];