Skip to content

Commit 46556e4

Browse files
committed
improvement: added author and contributor in generated package.json
Closes #27
1 parent 3af14ce commit 46556e4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

saofile.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module.exports = {
5353
files: ["lib"],
5454
publishConfig: { access: "public" },
5555
keywords: [],
56-
author: "",
56+
author: undefined,
5757
contributors: [],
5858
repository: "",
5959
license: "ISC",
@@ -89,6 +89,16 @@ module.exports = {
8989
peerDependencies: [{ react: "*" }, { "react-dom": "*" }]
9090
};
9191

92+
const authorObject = [];
93+
if (author) {
94+
authorObject.push(author);
95+
if (email) authorObject.push(`<${email}>`);
96+
}
97+
if (authorObject.length) {
98+
package.author = authorObject.join(" ");
99+
package.contributors.push(authorObject.join(" "));
100+
}
101+
92102
const rollupConfig = {
93103
input: "./src/index.tsx",
94104
output: [],

0 commit comments

Comments
 (0)