We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0513c6c commit f709afbCopy full SHA for f709afb
package.json
@@ -6,7 +6,7 @@
6
"types": "typescript/index.d.ts",
7
"type": "module",
8
"scripts": {
9
- "postinstall": "tsc",
+ "postinstall": "node scripts/postinstall.js",
10
"test": "echo \"Error: no test specified\" && exit 1"
11
},
12
"keywords": [
scripts/postinstall.js
@@ -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' });
+ console.log('TypeScript detected, running tsc...');
+ execSync('tsc', { stdio: 'inherit' });
+} catch (error) {
+ console.warn('TypeScript is not installed. Skipping compilation.');
+}
0 commit comments