MIT License
Implements RFC#939: import.meta.glob for ember-classic (pre-embroider).
See working demos here: https://github.com/NullVoxPopuli/ember-import-meta-glob-demos
allowAppImports
config
babel-plugin-transform-vite-meta-glob
pnpm add ember-classic-import-meta-glob
Default usage:
// If you type this in your app:
const widgets = import.meta.glob('./widgets/*.js')
// It gets automatically converted into something like this:
const widgets = {
'./widgets/first.js': () => import('./widgets/first.js'),
'./widgets/second.js': () => import('./widgets/second.js'),
}
Example with eager: true
// If you type this in your app:
const widgets = import.meta.glob('./widgets/*.js', { eager: true } )
// It gets automatically converted into something like this:
import * as a from './widgets/first.js';
import * as b from './widgets/first.js';
const widgets = {
'./widgets/first.js': a,
'./widgets/second.js': b,
}
glob
will not contain file name extensions, because they do not exist at runtime.For ember-classic, this is meant to ease migration to the new, modern features, reducing the overall diff you'd need if you didn't have entire feature sets that are available to embroider.
See the Contributing guide for details.
This project is licensed under the MIT License.