From 9e42991c9dad214935d10497c18279cb29c3b613 Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Tue, 21 Aug 2018 17:53:01 -0700 Subject: [PATCH] Fix module loading on systems that use '\' instead of '/' as the path separator. --- packages/jsii-kernel/lib/kernel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jsii-kernel/lib/kernel.ts b/packages/jsii-kernel/lib/kernel.ts index bcbd4e5ffc..867f4d5d00 100644 --- a/packages/jsii-kernel/lib/kernel.ts +++ b/packages/jsii-kernel/lib/kernel.ts @@ -126,7 +126,7 @@ export class Kernel { await fs.move(path.join(staging, 'package'), packageDir); // load the module and capture it's closure - const closure = this._execute(`require("${packageDir}")`, packageDir); + const closure = this._execute(`require(String.raw\`${packageDir}\`)`, packageDir); const assm = new Assembly(assmSpec, closure); this._addAssembly(assm);