Skip to content

Commit f709afb

Browse files
chore: update postinstall script
MV-885
1 parent 0513c6c commit f709afb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "typescript/index.d.ts",
77
"type": "module",
88
"scripts": {
9-
"postinstall": "tsc",
9+
"postinstall": "node scripts/postinstall.js",
1010
"test": "echo \"Error: no test specified\" && exit 1"
1111
},
1212
"keywords": [

scripts/postinstall.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { execSync } from 'child_process';
2+
3+
try {
4+
// Check if TypeScript is installed
5+
execSync('tsc --version', { stdio: 'ignore' });
6+
console.log('TypeScript detected, running tsc...');
7+
execSync('tsc', { stdio: 'inherit' });
8+
} catch (error) {
9+
console.warn('TypeScript is not installed. Skipping compilation.');
10+
}

0 commit comments

Comments
 (0)