🐛 Typescript tsc could not be located when building node in Node-Dev (#918)

*  Added variation of Typescript executable path based on OS of user

*  indentation fix (removed spaces)
This commit is contained in:
Rupenieks 2020-09-06 21:48:14 +02:00 committed by GitHub
parent f24afcd86f
commit 6aaae1ef6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,8 +63,15 @@ export async function createCustomTsconfig () {
export async function buildFiles (options?: IBuildOptions): Promise<string> {
options = options || {};
// Get the path of the TypeScript cli of this project
const tscPath = join(__dirname, '../../node_modules/.bin/tsc');
let typescriptPath;
// Check for OS to designate correct tsc path
if (process.platform === 'win32') {
typescriptPath = '../../node_modules/TypeScript/lib/tsc';
} else {
typescriptPath = '../../node_modules/.bin/tsc';
}
const tscPath = join(__dirname, typescriptPath);
const tsconfigData = await createCustomTsconfig();