Skip to content

Commit d783daa

Browse files
committed
fix(ci): add hotfix in built package.json to use proper file patterns in "files"
You can read more here: #405
1 parent 20c6ad2 commit d783daa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/fix-package-json.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
const {EOL} = require("os");
4+
5+
const pkgPath = path.join(__dirname, "../pkg/package.json");
6+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
7+
8+
pkg.files = pkg.files.map((file) => {
9+
if (file.endsWith("/")) {
10+
return file + "**";
11+
}
12+
return file;
13+
});
14+
15+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + EOL, "utf8");

0 commit comments

Comments
 (0)