Closed justyeh closed 5 years ago
The imagemin plugin uses 'spawn' which does not support in asar package. You should use 'execFile' instead.
I'm running into this same issue. @macisi can you explain a little more of how you'd use execFile
.
The crazy thing is everything works in Development and Production on my machine, but fails every time on Windows.
Here is my code for imagemin:
imagemin(
["/path/to/folder/to/optimize],
"/path/to/output/folder",
{
use: [imageminPngquant({ quality: "65-80" })]
}
)
.then(() => resolve(data))
.catch(err => reject(data))
I'm running into this same issue. @macisi can you explain a little more of how you'd use
execFile
. The crazy thing is everything works in Development and Production on my machine, but fails every time on Windows.Here is my code for imagemin:
imagemin( ["/path/to/folder/to/optimize], "/path/to/output/folder", { use: [imageminPngquant({ quality: "65-80" })] } ) .then(() => resolve(data)) .catch(err => reject(data))
@steveostudios Here is my code, hopes it would help😄 https://github.com/EHDFE/ehdev-shell/blob/master/src/controller/tools/processors/pngquant.js#L8
This is an issue with Electron and not Imagemin.
You can complain here: https://github.com/electron/electron/issues/9459
i hava create an image compress tool base on electron , use imagemin-pngquant to compress png file , it is useful in electron develop mode,but there is an error when i build electron to a exe file ,