-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
39 lines (37 loc) · 989 Bytes
/
Copy pathrollup.config.mjs
File metadata and controls
39 lines (37 loc) · 989 Bytes
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
import { defineConfig } from "rollup";
import { declarationsPlugin, jsPlugins } from "../../rollup.options.mjs";
import pkg from "./package.json" with { type: "json" };
const entrypoint = "src/index.ts";
export default defineConfig([
{
input: entrypoint,
output: [
{
file: pkg.types,
format: "es",
sourcemap: true,
},
],
plugins: declarationsPlugin({ compilerOptions: { composite: false } }),
},
{
input: entrypoint,
output: [
{
file: pkg.main,
format: "cjs",
sourcemap: true,
},
{ file: pkg.module, format: "es", sourcemap: true },
],
plugins: jsPlugins(pkg.version),
onwarn(warning, warn) {
// The optimization helpers reach V8 natives syntax
// (%OptimizeFunctionOnNextCall), which has no non-eval entry point.
if (warning.code === "EVAL" && warning.id?.endsWith("optimization.ts")) {
return;
}
warn(warning);
},
},
]);