Klathmon / imagemin-webpack-plugin

Plugin to compress images with imagemin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: ImageminPlugin is not a function

sharkrice opened this issue · comments

[10:14:16] Using gulpfile E:\workspace\sfdf-webapp\gulpfile.js
[10:14:16] Starting 'default'...
[10:14:16] Starting 'clean'...
[10:14:16] Finished 'default' after 2.87 ms
[10:14:16] Finished 'clean' after 4.72 ms
[10:14:16] Starting 'webpack'...
{"index":"E:\\workspace\\sfdf-webapp\\src\\scripts\\index.js"}

[10:14:17] 'webpack' errored after 540 ms
[10:14:17] TypeError: ImageminPlugin is not a function
    at Object.<anonymous> (E:\workspace\sfdf-webapp\build\webpack.prod.conf.js:44:3)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Gulp.<anonymous> (E:\workspace\sfdf-webapp\gulpfile.js:61:19)
    at module.exports (E:\workspace\sfdf-webapp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (E:\workspace\sfdf-webapp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (E:\workspace\sfdf-webapp\node_modules\orchestrator\index.js:214:10)
    at E:\workspace\sfdf-webapp\node_modules\orchestrator\index.js:279:18
    at finish (E:\workspace\sfdf-webapp\node_modules\orchestrator\lib\runTask.js:21:8)
    at E:\workspace\sfdf-webapp\node_modules\orchestrator\lib\runTask.js:43:4

in windows 7 bit
webpack 1.13.x

I'm gonna take a look at this tomorrow morning, can you post your webpack config somewhere?

I can't replicate this.

Can you either post your webpack config or a proof of concept for the bug to show where it's happening?

I think your problem might be the require statement.

make sure you require the library like this:

var ImageminPlugin = require('imagemin-webpack-plugin').default