-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathprepublish.cjs
More file actions
37 lines (34 loc) · 708 Bytes
/
prepublish.cjs
File metadata and controls
37 lines (34 loc) · 708 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
const fs = require("fs");
const pkg = require("./package.json");
// NOTE(roerohan): remove dependencies that are not needed for the library.
const {
react,
"react-dom": reactDom,
"web-vitals": webVitals,
...dependencies
} = pkg.dependencies;
const peerDependencies = {
react: ">=19.0.0",
"react-dom": ">=19.0.0",
};
fs.writeFileSync(
"package.json",
JSON.stringify(
{
name: pkg.name,
description: pkg.description,
version: pkg.version,
repository: pkg.repository,
keywords: pkg.keywords,
main: pkg.main,
module: pkg.module,
exports: pkg.exports,
typings: pkg.typings,
publishConfig: pkg.publishConfig,
dependencies,
peerDependencies,
},
null,
4,
),
);