1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +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:
Linus Groh 2022-06-26 21:00:55 +01:00
parent 2b3dd87296
commit 93b4c3bb82
3 changed files with 42 additions and 6 deletions

View file

@ -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" };