webpack-contrib/install-webpack-plugin

Strip webpack directives before running npm install

andersekdahl opened this issue · 3 comments

Thanks for a great loader!

With Wepack you can specify loaders in the require/import statement like this:

import logotype from '!!raw!image-webpack!./logo.svg';

Which this loader will pick up and try to install it. And that install will fail and print a bunch or errors in the console.
Perhaps check if the import/require contains ! and then ignore it? Or make it possible to provide a RegEx for import/require statements that this loader should ignore.

By porting this to a plugin, this should get fixed.

On Fri, Jan 8, 2016 at 7:18 AM Anders Ekdahl notifications@github.com
wrote:

Thanks for a great loader!

With Wepack you can specify loaders in the require/import statement like
this:

import logotype from '!!raw!image-webpack!./logo.svg';

Which this loader will pick up and try to install it. And that install
will fail and print a bunch or errors in the console.
Perhaps check if the import/require contains ! and then ignore it? Or
make it possible to provide a RegEx for import/require statements that this
loader should ignore.


Reply to this email directly or view it on GitHub
#12.

  • Eric Clemmons

Confirmed this works in #5, as I'm using css-loader, file-loader, and url-loader.

Looks like a great solution, thanks!