Skip to content

Commit 2310790

Browse files
committed
Remove use of path
1 parent bc5cf9d commit 2310790

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { basename } from 'path'
2-
31
const modules = import.meta.glob('./*.json', { eager: true, import: 'default' })
42

53
export default Object.fromEntries(Object.entries(modules).map(([path, module]) => {
6-
return [basename(path, '.json'), module]
4+
const name = path.split('/').pop().split('.').shift()
5+
return [name, module]
76
}))

0 commit comments

Comments
 (0)