mrnocreativity / postcss-critical-split

A PostCSS plugin that takes existing CSS files and splits out the annotated critical styles into a seperate file.
MIT License
89 stars 6 forks source link

TypeError: originalCss.walk is not a function #9

Closed menelikw closed 6 years ago

menelikw commented 7 years ago

So i freshly installed this plugin and got the above error...

Running gulp v4 (same issue in gulp 3)

Gulp task: (plugins loaded with gulp-load-plugin')

gulp.task('critical-split', () =>
    gulp.src([`${src.styles}/*.css`, '!**/*-critical.css'])
        .pipe($.postcss($.postcssCriticalSplit()))
);

Any ideas?

EDIT: Oh i found the issue, postcss plugins just needed to be passed in as an array e.g.

gulp.task('critical-split', () =>
    gulp.src([`${src.styles}/*.css`, '!**/*-critical.css'])
        .pipe($.postcss([
            $.postcssCriticalSplit()
        ]))
);