aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Devin Johw <143488669+DevinJohw@users.noreply.github.com> 2023-09-29 13:13:52 +0800
committerGravatar GitHub <noreply@github.com> 2023-09-28 22:13:52 -0700
commit315125c43adced310b02e9606b55338ca31b161a (patch)
tree72573c3362f0dd4f1d8171d8aa7bd157c2989673
parentf6fbf869105f7580d408c1802b6fd91148f5a887 (diff)
downloadbun-315125c43adced310b02e9606b55338ca31b161a.tar.gz
bun-315125c43adced310b02e9606b55338ca31b161a.tar.zst
bun-315125c43adced310b02e9606b55338ca31b161a.zip
docs (runtime): the order of checking files when using bare impoort (#5919)
-rw-r--r--docs/runtime/modules.md11
1 files changed, 8 insertions, 3 deletions
diff --git a/docs/runtime/modules.md b/docs/runtime/modules.md
index cfda31e3b..486ddea5f 100644
--- a/docs/runtime/modules.md
+++ b/docs/runtime/modules.md
@@ -33,15 +33,20 @@ Hello world!
In this case, we are importing from `./hello`, a relative path with no extension. **Extensioned imports are optional but supported.** To resolve this import, Bun will check for the following files in order:
-- `./hello.ts`
- `./hello.tsx`
-- `./hello.js`
+- `./hello.jsx`
+- `./hello.ts`
- `./hello.mjs`
+- `./hello.js`
- `./hello.cjs`
+- `./hello.json`
+- `./hello/index.tsx`
+- `./hello/index.jsx`
- `./hello/index.ts`
+- `./hello/index.mjs`
- `./hello/index.js`
+- `./hello/index.cjs`
- `./hello/index.json`
-- `./hello/index.mjs`
Import paths are case-insensitive, meaning these are all valid imports: