I am trying import all the files matching a glob pattern using Snowpack:
import allFiles from '../static/posts/**/*.md';
In Rollup you can achieve it with rollup-plugin-glob, is there anything like that in Snowpack ecosystem?
Snowpack has just released support for glob importing in 3.2.1! The syntax mirrors Vite's glob import support, so code likeā¦
const modules = import.meta.glob('./dir/*.js')
would be transformed into the following:
const modules = {
'./dir/foo.js': () => import('./dir/foo.js'),
'./dir/bar.js': () => import('./dir/bar.js')
}
Currently Snowpack doesn't support importing multiple files matching a glob pattern, but there is an open issue to implement this feature, so I guess this will eventually be supported.