This repository was archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
142 lines (140 loc) · 3.89 KB
/
index.ts
File metadata and controls
142 lines (140 loc) · 3.89 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import alias from '@rollup/plugin-alias';
import beep from '@rollup/plugin-beep';
import commonjs from '@rollup/plugin-commonjs';
import html from '@brixtol/rollup-html';
import json from '@rollup/plugin-json';
import multi from '@rollup/plugin-multi-entry';
import polyfills from 'rollup-plugin-node-polyfills';
import postcss from 'rollup-plugin-postcss';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import dts from 'rollup-plugin-dts';
import esbuild, { minify } from 'rollup-plugin-esbuild';
import bs from 'rollup-plugin-browsersync';
import type { Options } from 'browser-sync';
import type { Plugin } from 'rollup';
import copy from 'rollup-plugin-copy';
import del from 'rollup-plugin-delete';
import filesize from 'rollup-plugin-filesize';
import { terser } from 'rollup-plugin-terser';
import { ESBuild, ESMinify } from './types/esbuild';
export { defineConfig as rollup } from 'rollup';
export { config, env, banner, jsonmin, date } from '@brixtol/rollup-utils';
/**
* Rollup Plugins
*
* A helper export of rollup plugins used within packages
* maintained by [Brixtol](htpps://brixtol.com).
*/
export const plugin = {
/**
* Serve bundle via Browser Sync
*
* [rollup-plugin-browsersync](https://git.io/JXjkK)
*/
get bs (): (options: Options) => Plugin { return bs; },
/**
* Alias modules in a build.
*
* [@rollup/plugin-alias](https://git.io/JuTc9)
*/
get alias () { return alias; },
/**
* Beeps when a build ends with errors.
*
* [@rollup/plugin-beep](https://git.io/JuTEW)
*/
get beep (): () => Plugin { return beep; },
/**
* Copy files and folders, with glob support.
*
* [rollup-plugin-copy](https://git.io/JuTux)
*/
get copy () { return copy; },
/**
* Convert CommonJS modules to ES Modules
*
* [@rollup/plugin-commonjs](https://git.io/JuTcI)
*/
get commonjs () { return commonjs; },
/**
* Delete files and folders.
*
* [rollup-plugin-delete](https://git.io/JuTz3)
*/
get del () { return del; },
/**
* Rolls`.d.ts? definition files, used together with
* esbuild.
*
* rollup-plugin-dts](https://git.io/J1ykd)
*/
get dts () { return dts; },
/**
* ESBuild integration for minification and TypeScript support.
*
* [rollup-plugin-esbuild](https://git.io/J1DEP)
*/
get esbuild () { return esbuild as typeof ESBuild; },
/**
* Show filesize in the cli
*
* [rollup-plugin-filesize](https://git.io/JuTzw)
*/
get filesize () { return filesize; },
/**
* Creates HTML files to serve Rollup bundles
*
* [rollup-plugin-html](https://github.com/brixtol/rollup-html#readme)
*/
get html () { return html; },
/**
* Convert JSON files to ES Modules.
*
* [@rollup/plugin-json](https://git.io/JuTni)
*/
get json () { return json; },
/**
* Allows use of multiple entry points for a bundle.
*
* [@rollup/plugin-multi-entry](https://git.io/JwRT2)
*/
get multi () { return multi; },
/**
* Allows the node builtins to be required/imported.
*
* [rollup-plugin-node-polyfills](https://git.io/JuTuV)
*/
get polyfills () { return polyfills; },
/**
* Seamless integration between Rollup and PostCSS.
*
* [rollup-plugin-postcss](https://git.io/JuEZg)
*/
get postcss () { return postcss; },
/**
* Use the Node resolution algorithm.
*
* [@rollup/plugin-node-resolve](https://git.io/JOqCR)
*
*/
get resolve () { return resolve; },
/**
* Replace occurrences of a set of strings.
*
* [@rollup/plugin-replace](https://git.io/JuTcC)
*/
get replace () { return replace; },
/**
* Minify using esbuild
*
* [rollup-plugin-esbuild](https://git.io/J1DEP)
*/
get esminify () { return minify as typeof ESMinify; },
/**
* Minify generated es bundle using terser under the hood.
*
* [rollup-plugin-terser](https://git.io/JuTz5)
*/
get terser () { return terser; }
};