terpiljenya / import-glob

ES6 import with glob patterns (preloader for Webpack)
57 stars 28 forks source link

Non-matching globs don't generate any code #15

Open mrozekma opened 5 years ago

mrozekma commented 5 years ago

If the glob pattern matches no filenames, the loader returns an empty string. It should probably return an empty array, so that code like this:

import foo from './*.bar';
console.log(foo);

Doesn't result in "foo is not defined"