selectivizr icon indicating copy to clipboard operation
selectivizr copied to clipboard

Problem during grunt-uglify task

Open alanmarcos opened this issue 11 years ago • 6 comments

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?

alanmarcos avatar Mar 13 '14 23:03 alanmarcos

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

jbruni avatar Mar 19 '14 23:03 jbruni

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 [email protected] wrote:

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

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

jpdevries avatar Mar 19 '14 23:03 jpdevries

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 [email protected] wrote:

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

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

jpdevries avatar Mar 19 '14 23:03 jpdevries

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 avatar Aug 30 '14 13:08 ellioseven

Just a side note, you will need:

preserveComments: 'some'

to get selectivizr 1.0.3 to compile properly.

ellioseven avatar Sep 01 '14 13:09 ellioseven

Any idea why this is happening?

silvenon avatar Sep 23 '14 16:09 silvenon