forked from kriasoft/cloudflare-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
40 lines (36 loc) · 929 Bytes
/
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
/* SPDX-FileCopyrightText: 2020-present Kriasoft <[email protected]> */
/* SPDX-License-Identifier: MIT */
import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";
import del from "del";
import globby from "globby";
import stripExports from "rollup-plugin-strip-exports";
/**
* Rollup configuration.
*
* @see https://rollupjs.org/
* @type {import("rollup").RollupOptions}
*/
const config = {
output: {
dir: ".build",
format: "es",
minifyInternalExports: true,
sourcemap: "inline",
},
plugins: [
resolve({
extensions: [".ts", ".tsx", ".mjs", ".js", ".json", ".node"],
browser: true,
}),
babel({
extensions: [".js", ".mjs", ".ts", ".tsx"],
babelHelpers: "bundled",
}),
stripExports(),
],
};
del.sync(".build/**");
export default globby
.sync(["workers/*.ts", "!**.d.ts"])
.map((input) => ({ ...config, input }));