We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc5cf9d commit 2310790Copy full SHA for 2310790
examples/index.js
@@ -1,7 +1,6 @@
1
-import { basename } from 'path'
2
-
3
const modules = import.meta.glob('./*.json', { eager: true, import: 'default' })
4
5
export default Object.fromEntries(Object.entries(modules).map(([path, module]) => {
6
- return [basename(path, '.json'), module]
+ const name = path.split('/').pop().split('.').shift()
+ return [name, module]
7
}))
0 commit comments