Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont work with gulp4 #135

Closed
perryutkonos opened this issue Dec 26, 2017 · 8 comments
Closed

Dont work with gulp4 #135

perryutkonos opened this issue Dec 26, 2017 · 8 comments

Comments

@perryutkonos
Copy link

perryutkonos commented Dec 26, 2017

Dont work gulp.spritesmith in gulp4.

About in gulp 3 its ok g
gulp.spritesmith version - 6.7.0

TypeError: file.pipe is not a function
    at loadPixels (D:\Projects\Web\PROJ\local\.dev\node_modules\pixelsmith\lib\engine.js:40:16)
    at fn (D:\Projects\Web\PROJ\local\.dev\node_modules\pixelsmith\node_modules\async\lib\async.js:638:34)
    at Immediate.<anonymous> (D:\Projects\Web\PROJ\local\.dev\node_modules\pixelsmith\node_modules\async\lib\async.js:554:34)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

Gulp task:


var spriteData = gulp.src(path.src.sprite)
    .pipe(spritesmith({
    imgName: '../img/sprite.png',
    cssName: 'sprite.less',
    padding: 20
}));

// Pipe image stream through image optimizer and onto disk
var imgStream = spriteData.img
// DEV: We must buffer our stream into a Buffer for `imagemin`
    .pipe(gulp.dest(path.build.img));

// Pipe CSS stream through CSS optimizer and onto disk
var cssStream = spriteData.css
    .pipe(gulp.dest('src/css/blocks/'));

// Return a merged stream to handle both `end` events
return merge(imgStream, cssStream);
});
@twolfson
Copy link
Owner

This has been an open issue on pixelsmith for a while (twolfson/pixelsmith#10). However, I haven't seen/heard anything about a Gulp@4 release soon. Could you point me to this information? I don't even see Gulp@4 on npm =/

$ npm show gulp
{ name: 'gulp',
  description: 'The streaming build system',
  'dist-tags': { latest: '3.9.1' },
  versions:
   [ '0.0.1',
// ...
     '3.9.0',
     '3.9.1' ],
  maintainers:

@perryutkonos
Copy link
Author

I'm using alpha version gulp4 (https://github.com/gulpjs/gulp/tree/4.0), but I did not have problems with all Npm modules, not counting the spritesmith ((

@perryutkonos
Copy link
Author

perryutkonos commented Dec 26, 2017

@twolfson Is there a solution for using spritesmith with a version of gulp 4?

@twolfson
Copy link
Owner

In my opinion, Gulp@4 is still in development and thus a moving target so it's a waste of energy to try to support/use it at the moment. When there's a beta release on npm or in their git tag, then we should revisit it but until then there's nothing saying it's stable or near release =/

@st-schneider
Copy link

The problem seems to be relatively simple. in engine.js of the pixelsmith package in line 37 is a isNull check. It seems this is currently returning an incorrect value since although there is a file with path and so on isNull returns false.
So if you really want to use Gulp 4 you could change this or comment out the if condition and then it works.
But as @twolfson already said, gulp 4 being in alpha makes it difficult to fix this.

@aslinwang
Copy link

gulp 4 has been released.
https://github.com/gulpjs/gulp/tree/v4.0.0

@twolfson
Copy link
Owner

twolfson commented Jan 3, 2018

Cool, thanks for the heads up! I'll re-open this issue. Please see twolfson/pixelsmith#10 for ETA and resolution

@twolfson
Copy link
Owner

twolfson commented Jan 6, 2018

This has been resolved and released in 6.9.0

@twolfson twolfson closed this as completed Jan 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants