purifycss / gulp-purifycss

Removed unused CSS with the gulp build tool
MIT License
335 stars 21 forks source link

TypeError: Cannot read property 'styles' of undefined #30

Open oscarhandsome opened 4 years ago

oscarhandsome commented 4 years ago

Gulp task:

gulp.task('purifycss', function() {
    return gulp.src('src/assets/css/*.css')
        .pipe(purify(['src/assets/js/*.js', 'src/*.html']))
        .pipe(gulp.dest('src'));
});

issue:

[15:25:36] Starting 'purifycss'... [15:25:37] 'purifycss' errored after 1.15 s [15:25:37] TypeError: Cannot read property 'styles' of undefined at minify (C:\xampp\htdocs\projname.loc\node_modules\purify-css\lib\purifycss.js:994:51) at purify (C:\xampp\htdocs\projname.loc\node_modules\purify-css\lib\purifycss.js:1005:24) at C:\xampp\htdocs\projname.loc\gulpfile.js:208:15 at taskWrapper (C:\xampp\htdocs\projname.loc\node_modules\undertaker\lib\set-task.js:13:15) at bound (domain.js:415:14) at runBound (domain.js:428:12) at asyncRunner (C:\xampp\htdocs\projname.loc\node_modules\async-done\index.js:55:18) at processTicksAndRejections (internal/process/task_queues.js:75:11)

Can somebody explain what mean this issue?