diff --git a/StarlingMonkey b/StarlingMonkey index 53044ec8..30756b20 160000 --- a/StarlingMonkey +++ b/StarlingMonkey @@ -1 +1 @@ -Subproject commit 53044ec8f1d64f968fa45fe9afeef3993c92d10b +Subproject commit 30756b20b2b6d6ab108e21029fdacd83f2967f27 diff --git a/src/componentize.js b/src/componentize.js index 63187900..cf1dce94 100644 --- a/src/componentize.js +++ b/src/componentize.js @@ -215,11 +215,17 @@ export async function componentize(opts, // component to be relative to the current working directory. // This only works in wizer, not in weval, because the latter doesn't // support --mapdir. - if (!opts.enableAot && workspacePrefix.startsWith(cwd())) { - workspacePrefix = cwd(); - sourcePath = sourcePath.slice(workspacePrefix.length + 1); + if (!opts.enableAot) { + if (!useOriginalSourceFile) { + workspacePrefix = sourceDir; + sourcePath = sourceName; + } + if (workspacePrefix.startsWith(cwd())) { + workspacePrefix = cwd(); + sourcePath = sourcePath.slice(workspacePrefix.length + 1); + } } - let args = `--initializer-script-path ${initializerPath} ${sourcePath}`; + let args = `--initializer-script-path ${initializerPath} --strip-path-prefix ${workspacePrefix}/ ${sourcePath}`; runtimeArgs = runtimeArgs ? `${runtimeArgs} ${args}` : args; let preopens = [`--dir ${sourceDir}`]; if (opts.enableAot) {