Skip to content

Commit 412ae73

Browse files
Use npx for build script (#16)
The use of `tsc` in the postinstall script of this package means that even non-TS users will ultimately try to build the package on install. This doesn't really make sense, and can even break if typescript isn't transitively installed into their node_modules.
1 parent d5c6beb commit 412ae73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"node": ">=14.0"
1919
},
2020
"scripts": {
21-
"build": "tsc --build tsconfig.build.json",
21+
"//": "#use npx here to ensure that non-TS users triggering the postinstall script don't need to install TypeScript globally or in their project",
22+
"build": "npx -p typescript tsc --build tsconfig.build.json",
2223
"clean": "git clean -dfqX",
2324
"install-with-npm-8.5": "npm i -g npm@^8.5.0 && npm i",
2425
"postinstall": "npm run build",

0 commit comments

Comments
 (0)