mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibJS: Infer file extensions when resolving module paths
This allows `import "./foo"` to succeed, even if the file is actually called `foo.js`. IDEs commonly exclude file extensions in auto-imports. Closes #14364.
This commit is contained in:
parent
2b3dd87296
commit
93b4c3bb82
Notes:
sideshowbarker
2024-07-17 09:57:38 +09:00
Author: https://github.com/linusg
Commit: 93b4c3bb82
Pull-request: https://github.com/SerenityOS/serenity/pull/14394
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/davidot ✅
3 changed files with 42 additions and 6 deletions
|
@ -0,0 +1,5 @@
|
|||
// If all of these succeed, path resolution with implicit extensions is working.
|
||||
|
||||
import "./module-with-default";
|
||||
import "./submodule";
|
||||
import "./json-module" assert { type: "json" };
|
|
@ -0,0 +1 @@
|
|||
// Submodule, `import "./submodule"` should resolve to `submodule/index.js`.
|
Loading…
Add table
Add a link
Reference in a new issue