From 04d49902d048b5a1baeb9cea9a835c80ad07f259 Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Wed, 22 Aug 2018 14:13:43 -0400 Subject: [PATCH] Fix module loading on systems that use '\' instead of '/' as the path separator. (#193) --- 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);