img-loader icon indicating copy to clipboard operation
img-loader copied to clipboard

Cannot be used in webpack

Open suyizhang opened this issue 4 years ago • 1 comments

Because it is written in ESM, it can't be executed in webapck. Changing imagemin that loader depends on is also written in ESM

suyizhang avatar May 27 '21 06:05 suyizhang

img-loader works for me with webpack 5 in my own configuration, work with webpack 5 in laravel-mix.

Now I need it with nuxt that uses webpack 4 and a get this error:

Module build failed (from ./node_modules/img-loader/index.js): TypeError: Invalid host defined options at Object.module.exports (/Users/andrey.hohlov/work/repos/interfaces/starter-vue-nuxt/node_modules/img-loader/index.js:14:3)
localhost:3000 2021-06-10 17-15-32

I confirm the problem:

img-loader doesn't work with webpack < 5.

andrey-hohlov avatar Jun 10 '21 10:06 andrey-hohlov