Aintaer / import-glob-loader

Globbing preloader for Webpack
50 stars 16 forks source link

Use webpack internal require #1

Open braco opened 9 years ago

braco commented 9 years ago

Is there any way this could use the internal webpack require system? It looks like you're doing that manually, but this means you get none of the potential path/plugin manipulation that may take place in webpack's config.

Aintaer commented 7 years ago

Not without significantly changing the scope of the plugin. The plugin is meant to leverage the underlying sass loader to interpret the @import statements. Ideally the upstream sass loader itself would do this glob expansion.

As far as the path manipulations go, that's far more difficult to interpret a globbing pattern for. Webpack's loader work mostly with files and not directories. Webpack would need to know what file dependencies a globbing pattern would require (to place watchers and whatnot), something I was too lazy to figure out.

martinschayna commented 6 years ago

Is this the reason why url("/assets/image.png") doesn't work with webpack's output.publicPath option? It seems that path to those assets can't be prefixed with CDN path :(