Skip to content

Commit d6657f1

Browse files
committed
Fix building on windows when using new syntax
The new sytax uses cwd() to strip the prefix when building using original source location. We were not running it through maybeWindowsPath which led to file not being found during initialization. This PR fixes that and thus enables building on windows using the new syntax. Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
1 parent e5bb0da commit d6657f1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/componentize.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ function isNumeric(n) {
8585
}
8686

8787
export async function componentize(opts,
88-
_deprecatedWitWorldOrOpts = undefined,
89-
_deprecatedOpts = undefined) {
88+
_deprecatedWitWorldOrOpts = undefined,
89+
_deprecatedOpts = undefined) {
9090
let useOriginalSourceFile = true;
9191
let jsSource;
9292

@@ -246,8 +246,9 @@ export async function componentize(opts,
246246
workspacePrefix = sourceDir;
247247
sourcePath = sourceName;
248248
}
249-
if (workspacePrefix.startsWith(cwd())) {
250-
workspacePrefix = cwd();
249+
let currentDir = maybeWindowsPath(cwd());
250+
if (workspacePrefix.startsWith(currentDir)) {
251+
workspacePrefix = currentDir;
251252
sourcePath = sourcePath.slice(workspacePrefix.length + 1);
252253
}
253254
}

0 commit comments

Comments
 (0)