Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

UnCSS additionalTask #559

Open
rjdusk opened this issue Jun 20, 2018 · 1 comment
Open

UnCSS additionalTask #559

rjdusk opened this issue Jun 20, 2018 · 1 comment

Comments

@rjdusk
Copy link

rjdusk commented Jun 20, 2018

Hi all,
this is driving me around the bend. I've added an additionalTask like so:

additionalTasks: {
    initialize(gulp, PATH_CONFIG, TASK_CONFIG) {
      gulp.task('uncss', function() {
        var postcss = require('gulp-postcss');
        var uncss = require('postcss-uncss');
        var plugins = [
        uncss({
            html: ['https://mbdnext.local']
        }),
      ];
      return gulp.src('./public/assets/stylesheets/*.css')
        .pipe(postcss(plugins))
        .pipe(gulp.dest('./public/assets/stylesheets/app.min.css'));
      })
    },
    development: {
      prebuild: [],
      postbuild: []
    },
    production: {
      prebuild: [],
      postbuild: ['uncss']
    }
  },

But everytime I run yarn run blendid -- build it starts running build and then taps out 2 seconds later, it tells me its done.

Has anyone here successfully got UnCSS running with Blendid? Thanks for any pointers!

@yannou788
Copy link

yannou788 commented Sep 20, 2018

Hi the solution is to remove the empty array.

    initialize(gulp, PATH_CONFIG, TASK_CONFIG) {
      gulp.task('uncss', function() {
        var postcss = require('gulp-postcss');
        var uncss = require('postcss-uncss');
        var plugins = [
        uncss({
            html: ['https://mbdnext.local']
        }),
      ];
      return gulp.src('./public/assets/stylesheets/*.css')
        .pipe(postcss(plugins))
        .pipe(gulp.dest('./public/assets/stylesheets/app.min.css'));
      })
    },
    production: {
      postbuild: ['uncss']
    }
  },```

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants