-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
79 lines (68 loc) · 1.89 KB
/
rollup.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
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
import cleanup from 'rollup-plugin-cleanup'; // Remove comments, supports sourcemap
import postcss from 'rollup-plugin-postcss'; // Include CSS
import image from '@rollup/plugin-image'; // Include Images
import json from '@rollup/plugin-json'; // Import JSON
import terser from '@rollup/plugin-terser'; // Remove comments, minify
import pkg from './package.json';
function header() {
return {
renderChunk(code) {
return `/**
* @description Suey
* @about Lightweight JavaScript UI library.
* @author Stephens Nunnally <@stevinz>
* @license MIT - Copyright (c) 2024 Stephens Nunnally
* @source https://github.com/onsightengine/suey
* @version v${pkg.version}
*/
${code}`;
}
};
}
const builds = [
{ // Standard
input: './src/Suey.js',
treeshake: false,
plugins: [
cleanup({
comments: 'none',
extensions: [ 'js', 'ts' ],
sourcemap: false,
}),
json(),
postcss({
extensions: [ '.css' ],
}),
image(),
],
output: [{
format: 'esm',
file: './dist/suey.module.js',
sourcemap: false,
plugins: [
header(),
],
}],
},
{ // Minified
input: './src/Suey.js',
treeshake: false,
plugins: [
json(),
postcss({
extensions: [ '.css' ],
}),
image(),
],
output: [{
format: 'esm',
file: './dist/suey.min.js',
sourcemap: false,
plugins: [
terser({ format: { comments: false } }),
header(),
],
}],
},
];
export default builds;