-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(runner): resolve and normalize absolute path in fetchModule
#18361
base: main
Are you sure you want to change the base?
Changes from 4 commits
0f1ca5b
1913865
de0a2f8
5e8e7ec
2c3170c
3726ec3
f001b7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,10 @@ export const initialize = async () => { | |
dynamicRelative: await import(nameRelative), | ||
dynamicAbsolute: await import(nameAbsolute), | ||
dynamicAbsoluteExtension: await import(nameAbsoluteExtension), | ||
dynamicAbsoluteFull: await import(path.join(import.meta.dirname, "simple.js")), | ||
dynamicAbsoluteFull: await import(path.join( | ||
hi-ogawa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
...process.platform === 'win32' ? ['/@fs'] : [], | ||
import.meta.dirname, "simple.js" | ||
)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After the change, for Windows, I think I added this test case in #17422 saying it's broken in v6, but maybe it was already broken on v5 if I tested it on Windows 😅 |
||
static: staticModule, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ export async function createModuleRunnerTester( | |
} | ||
}, | ||
}, | ||
...(config.plugins ?? []), | ||
], | ||
...config, | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the addition of
resolveId
infetchModule
makes this irrelevant. The only downside is the additional call to the server if the entry point is not normalized, but it was already imported.If we move this to the environment, then maybe this whole function can be removed, which also makes it so the
root
is not required anymoreThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I moved everything to
fetchModule
includingfile://
handling. It looks like this works, but the behavior offile://
might be actually different from browser and v5 since Astro is relying on userland plugin #17369 (comment)(though In my opinion, supporting
file://
out of the box seems nice to have anyways)