Monday, 17 April 2017

running grunt task twice results in error Cannot call method 'forEach' of undefined Use

New to grunt I have successfully used it to run purifycss. No I want to run purifycss twice with different arguments, and ideally concat the two resulting files afterwards. What I have so far is this Gruntfile:`module.exports = function(grunt) {

grunt.initConfig({
    purifycss: {
      bootstrap: {
        options: {},
        target: {
              src: [ 'live/*.twig' ],
              css: ['live/css/bootstrap*.css'],
              dest: 'purified_bootstrap.css'
                }
            },
      mycss: {
        options: {},
        target: {
              src: [ 'live/*.twig' ],
              css: ['live/css/mycss.css'],
              dest: 'purified_mycss.css'
                }
            }
      }
});

grunt.loadNpmTasks('grunt-purifycss');
grunt.registerTask('purify', ['purifycss:bootstrap', 'purifycss:mycss']);

};`

The output I get when running grunt purify from terminal:

grunt purify Running "purifycss:bootstrap" (purifycss) task Warning: Cannot call method 'forEach' of undefined Use --force to continue. Aborted due to warnings.

Any help on what's going wrong here appreciated!



via Chransen

No comments:

Post a Comment