generated from run-slicer/script-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.ts
40 lines (38 loc) · 1.04 KB
/
rollup.config.ts
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
import { readFile } from "node:fs/promises";
import type { RollupOptions } from "rollup";
import typescript from "@rollup/plugin-typescript";
import replace from "@rollup/plugin-replace";
import nodeResolve from "@rollup/plugin-node-resolve";
const { version } = JSON.parse(await readFile("./package.json", "utf8"));
export default [
{
input: "src/index.ts",
output: {
dir: "dist",
format: "esm",
},
plugins: [
nodeResolve(),
typescript(),
replace({
preventAssignment: true,
__SCRIPT_VERSION__: JSON.stringify(version),
}),
],
},
{
input: "src/worker.ts",
output: {
dir: "dist",
format: "esm",
},
plugins: [
nodeResolve(),
typescript(),
replace({
preventAssignment: true,
__SCRIPT_VERSION__: JSON.stringify(version),
}),
],
},
] satisfies RollupOptions[];