img-loader
img-loader copied to clipboard
Cannot be used in webpack
Because it is written in ESM, it can't be executed in webapck. Changing imagemin that loader depends on is also written in ESM
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)
I confirm the problem:
img-loader doesn't work with webpack < 5.