Skip to content

Commit

Permalink
fix(build): bugfix npm package
Browse files Browse the repository at this point in the history
Remove packages from build due to npm using `files` path in any `package.json` it sees.
  • Loading branch information
zeruk committed Oct 18, 2022
1 parent 1304d4c commit 4db3425
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions fixup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

package_version=`npm show . version`

for target in esm cjs; do
cat >build/$target/package.json <<!EOF
{
"version": "$package_version"
}
!EOF
done
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test": "npm run test:unit",
"build": "tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json",
"clean": "rm -rf build",
"prepublish": "npm run clean && npm run build",
"prepublish": "npm run clean && npm run build && ./fixup.sh",
"release": "standard-version"
},
"keywords": [
Expand Down
3 changes: 2 additions & 1 deletion tsconfig-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"certs"
],
"exclude": [
"node_modules"
"node_modules",
"package.json"
]
}

0 comments on commit 4db3425

Please sign in to comment.