mixtur / webpack-spritesmith

Webpack plugin that converts set of images into a spritesheet and SASS/LESS/Stylus mixins
498 stars 56 forks source link

Fails when Source Folder has Subfolders with Images #83

Closed Rakhmanov closed 5 years ago

Rakhmanov commented 5 years ago

In version 1.0.0, Changes have broke our webpack configuration code with following error: { Error: EISDIR: illegal operation on a directory, read errno: -21, code: 'EISDIR', syscall: 'read' }.

What happened is now spiritesmith was trying reading content of the subfolder as if it was a file. Folder was supplied to it as a valid path for a sprite, then it fatally crashed.

I'm working on getting it filtered out. And expecting to have pull request for it.

mixtur commented 5 years ago

So before 1.0.0 it was fine? I can only imagine this happening if you have .png in your directory's name. Is that the case?

Rakhmanov commented 5 years ago

The name of the folder does not have png in its name naturally.

The reason is that list of pngs now is obtained through call to the method gaze.watched() which return folder names and files watched. Contrary to it's documentation. So it is easy to get confused.

To fix that, I have been able to make it work by filtering results that contain "/" as a last symbol. Which is consistent with method call results.

Where before version 1.0.0 it was done though glob query, which was getting files matched directly.

On Mar 12, 2019 10:20 PM, Michael Turkeev notifications@github.com wrote:

So before 1.0.0 it was fine? I can only imagine this happening if you have .png in your directory's name. Is that the case?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mixtur/webpack-spritesmith/issues/83#issuecomment-472283790, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AChDKHyHYnN5c8u5cZf1Kh2l2vd0W2Wgks5vWIqxgaJpZM4brxcc.

lobodol commented 5 years ago

Hello, I face the same issue. As long as there is no sub-folder in my assets/ dir, the plugin works fine. But as soon as I move some images in a sub-folder,I got the same error message.

Are you planing to fix this issue soon ?

mixtur commented 5 years ago

should be fixed in 1.0.1