keithclark / selectivizr

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.
1.71k stars 246 forks source link

Problem during grunt-uglify task #85

Open alanmarcos opened 10 years ago

alanmarcos commented 10 years ago

Whenever i try to concatenate selectivizr with some other files, the selectivizr itself doesn't get compiled at all. It just come out blank.

Is there anyone having the same issue?

jbruni commented 10 years ago

Consider this code at the beginning of selectivzr:

if (/*@cc_on!@*/true) return;

Uglify reads it as if (true) return; - so it triggers the corresponding minification, excluding the remaining of the file. Try removing this line and you will see it "compiled". (Just to verify. This is not a solution.)

More: http://stackoverflow.com/questions/17744175/using-uglify-grunt-task-messes-up-selectivizr

jpdevries commented 10 years ago

This is good to know, curious why would you concatenate selectivizr with other files? Are the files being bundled polyfills for old browsers also?— Sent from Mailbox for iPhone

On Wed, Mar 19, 2014 at 4:35 PM, J Bruni notifications@github.com wrote:

Consider this code at the beginning of selectivzr: if (/_@ccon!@/true) return; Uglify reads it as if (true) return; - so it triggers the corresponding minification, excluding the remaining of the file. Try removing this line and you will see it "compiled". (Just to verify. This is not a solution.)

More: http://stackoverflow.com/questions/17744175/using-uglify-grunt-task-messes-up-selectivizr

Reply to this email directly or view it on GitHub: https://github.com/keithclark/selectivizr/issues/85#issuecomment-38120533

jpdevries commented 10 years ago

I think I just answered my own question. I've bundled selectivizr with nwmatcher before to get all the selectors. — Sent from Mailbox for iPhone

On Wed, Mar 19, 2014 at 4:35 PM, J Bruni notifications@github.com wrote:

Consider this code at the beginning of selectivzr: if (/_@ccon!@/true) return; Uglify reads it as if (true) return; - so it triggers the corresponding minification, excluding the remaining of the file. Try removing this line and you will see it "compiled". (Just to verify. This is not a solution.)

More: http://stackoverflow.com/questions/17744175/using-uglify-grunt-task-messes-up-selectivizr

Reply to this email directly or view it on GitHub: https://github.com/keithclark/selectivizr/issues/85#issuecomment-38120533

ellioseven commented 10 years ago

I find that 1.0.3 doesn't have this problem with grunt-contib-uglify.

The only problem is that I only get 1.0.2 with bower?

ellioseven commented 10 years ago

Just a side note, you will need:

preserveComments: 'some'

to get selectivizr 1.0.3 to compile properly.

silvenon commented 10 years ago

Any idea why this is happening?