Skip to content

Timing Problems with many files #227

Description

@benedikt-bartscher

Grunt is running kinda out of sync if i process many files with uncss and compress.

Example Gruntfile:

module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.readJSON('aws-keys.json'),
      uncss: {
        dist: {
	  options: {
            ignore: [
		    '.collapsing',
		    '.collapsed',
	            ],
            ignoreSheets: [/fonts.googleapis/],
            htmlroot: './src',
          },
	  files: [{
            expand: true,
            cwd: 'src/',
            src: ['**/index.html'],
            dest: 'dist/',
	    ext: '.css'
          }]
	}
      },
      compress: {
        options: {
          mode: 'brotli',
          brotli: {
            mode: 1
          }
        },
        css: {
	  files: [
	    {expand: true, cwd: 'dist/', src: ['**/*.css'], dest: 'dist/', extDot: 'last', ext: '.css.br'},
	  ]
        },
      },
  });
  grunt.loadNpmTasks('grunt-uncss');
  grunt.loadNpmTasks('grunt-contrib-compress');
  grunt.registerTask('css', ['uncss', 'compress:css']);
};

Excerpt from Log:

Running "uncss:dist" (uncss) task
[...]
File dist/privat/altersvorsorge/schicht-2-direktversicherung/index.css created: 729.44 kB → 42.53 kB
File dist/impressum/index.css created: 729.44 kB → 34.63 kB
File dist/privat/die-pkv/besondere-tarife/index.css created: 729.44 kB → 42.23 kB
File dist/privat/die-pkv/index.css created: 729.44 kB → 42.53 kB

Running "compress:css" (compress) task
>> Compressed 95 files.
File dist/privat/die-pkv/pkv-und-beihilfe/index.css created: 729.44 kB → 42.37 kB
File dist/privat/die-pkv/pkv-fuer-kinder/index.css created: 729.44 kB → 40.15 kB
File dist/privat/index.css created: 729.44 kB → 33.77 kB
[...]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions