Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing Problems with many files #227

Open
benedikt-bartscher opened this issue Sep 3, 2020 · 1 comment
Open

Timing Problems with many files #227

benedikt-bartscher opened this issue Sep 3, 2020 · 1 comment

Comments

@benedikt-bartscher
Copy link

benedikt-bartscher commented Sep 3, 2020

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
[...]
@nadir-hussain
Copy link

Raised a PR to fix the issue. #229

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

No branches or pull requests

2 participants