Skip to content

Commit 88c879c

Browse files
gaodengsatya164
authored andcommitted
fix: use tsc.cmd on windows for typescript (#3)
1 parent 19f1f1a commit 88c879c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/targets/typescript.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ import path from 'path';
33
import child_process from 'child_process';
44
import fs from 'fs-extra';
55
import del from 'del';
6+
import { platform } from 'os';
67
import { Input } from '../types';
78

89
export default async function build({ root, output, report }: Input) {
9-
report.info(`Cleaning up previous build at ${chalk.blue(path.relative(root, output))}`);
10+
report.info(
11+
`Cleaning up previous build at ${chalk.blue(path.relative(root, output))}`
12+
);
1013

1114
await del([output]);
1215

1316
report.info(`Generating type definitions with ${chalk.blue('tsc')}`);
1417

15-
const tsc = path.join(root, 'node_modules', '.bin', 'tsc');
18+
const tsc =
19+
path.join(root, 'node_modules', '.bin', 'tsc') +
20+
(platform() === 'win32' ? '.cmd' : '');
21+
1622
const tsconfig = path.join(root, 'tsconfig.json');
1723

1824
try {

0 commit comments

Comments
 (0)