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

Styles are being duplicated with >= 2.0.0 #291

Open
stefangrund opened this issue Jun 2, 2017 · 8 comments
Open

Styles are being duplicated with >= 2.0.0 #291

stefangrund opened this issue Jun 2, 2017 · 8 comments

Comments

@stefangrund
Copy link

We just updated our build process (runs on Node 5) to use grunt-contrib-cssmin 2.2.0 and now we're experiencing that all the styles in our css file are being duplicated in the *.min.css, which is generated with grunt-contrib-cssmin >= 2.0.0.

After we downgraded back to 1.0.2 everything works fine.

Here's our configuration, but I guess that's not the problem. Maybe it's an issue with clean-css?

Any ideas?

@pgossmann
Copy link

Any news on this?
We faced the exact same issue causing errors in IE which is used by our clients.
Thanks for raising the issue here. We downgraded as well and it works fine again.

@XhmikosR
Copy link
Member

I need the smallest test case I can reproduce the issue or make sure it's not an issue with clean-css.

@Romkond
Copy link

Romkond commented Aug 11, 2017

The same issue with 2.2.1.

@XhmikosR
Copy link
Member

#291 (comment)

@Romkond
Copy link

Romkond commented Aug 11, 2017

@XhmikosR Ehm... Do you need any settings/examples?
Here is the sode:

concat: {
    dist: {},
		
		critic: {
          files: [{
            nonull: true,
            src: ['public_html/test/www-critical/critical1.css'...,'public_html/test/www-critical/critical17.css',],
            dest: 'public_html/test/css/critical.css'
        }]
        },
		
	},
	
critical: {
		test1: {
			options: {
				base: 'public_html',
				css: [
					'public_html/assets/templates/thesite/css/concat.min.css'
				],
				width: 1024,
				height: 768
			},
			src: 'public_html/test/www-processed/index.html',
			dest: 'public_html/test/www-critical/critical1.css'
		},
		
		...
		
		test17: {},
	
	
cssmin: {
        target: {},
				
        critic: {
           files: [{
              expand: true,
              cwd: 'public_html/test/css/',
              src: ['critical.css'],
              dest: 'public_html/assets/templates/thesite/css/',
              ext: '.min.css'
            }]
        }
    },
	

  
    ...
	'clean',
	'uncss',
	'concat:dist',
	'cssmin:target',
	'fetchpages',
	'processhtml',
	'critical',
	'concat:critic',
	'cssmin:critic',

Here is the result:
https://drive.google.com/file/d/0B0hmakB01_IcV1RjY1R6OGJwWE0/view?usp=sharing

@XhmikosR
Copy link
Member

I just don't see how cssmin can cause this. Something in your plugins chain is causing it. Try removing critical.

@Romkond
Copy link

Romkond commented Aug 11, 2017

I can launch it with just grunt cssmin:critic and result will be the same.
I've just downgraded to 1.0.2. It's okay now:
https://drive.google.com/file/d/0B0hmakB01_IcTDc0Z1NNOWVWZlU/view?usp=sharing
Old version used to REMOVE duplicates (there are really there in my source file critical.css).
Need my SSH? Let me know then.

@XhmikosR
Copy link
Member

I honestly don't see anything that could have caused this from our side.

It's either an upstream issue (or configuration) or something in your workflow.

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

4 participants