From 1109edf28892854c67121c9ea15db634a559cf97 Mon Sep 17 00:00:00 2001 From: chnguyen Date: Mon, 7 Mar 2022 14:30:12 +0700 Subject: [PATCH] Fix require path on windows --- src/AppsCompiler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AppsCompiler.ts b/src/AppsCompiler.ts index 40f03cb..4aa1674 100644 --- a/src/AppsCompiler.ts +++ b/src/AppsCompiler.ts @@ -1,4 +1,5 @@ import * as fs from 'fs'; +import * as path from 'path'; import * as fallbackTypescript from 'typescript'; import { createRequire } from 'module'; @@ -26,7 +27,7 @@ export class AppsCompiler { private readonly sourcePath: string, ts: TypeScript = fallbackTypescript, ) { - this.validator = new AppsEngineValidator(createRequire(`${ sourcePath }/app.json`)); + this.validator = new AppsEngineValidator(createRequire(path.join(sourcePath, 'app.json'))); this.typescriptCompiler = new TypescriptCompiler(sourcePath, ts, this.validator); this.bundler = getBundler(AvailableBundlers.esbuild);