Git Product home page Git Product logo

Comments (9)

colinskow avatar colinskow commented on June 8, 2024 13

I have been having the same issue. I made it work by specifying the comments options manually

.pipe(uglify({output: {comments: /^!|@preserve|@license|@cc_on/i}}))

from gulp-uglify.

terinjokes avatar terinjokes commented on June 8, 2024

@ShiJinYu If you swap the order of the "origin" and "do not delete" comments, does it work?

from gulp-uglify.

gideonstele avatar gideonstele commented on June 8, 2024

No, it doesn't work.
I just want to put the HTML template code in a javascript file,in the form of js comment.But Uglify looks does not correctly identify it.
In addition,if I set the value of preserveComments as 'all',all comments would be preserved but the comment as this form:

String(function(){
    /*! I will be deleted in any case
    <div class="foo">{{bar}}</div>
    */
    })

from gulp-uglify.

taylortom avatar taylortom commented on June 8, 2024

I'm also experiencing the same issue. I can't get any values of preserveComments to work besides none.

from gulp-uglify.

gideonstele avatar gideonstele commented on June 8, 2024

What a pity! It is really a very strange requirement what I had encountered.

from gulp-uglify.

terinjokes avatar terinjokes commented on June 8, 2024

This might be a regression in how uglifyjs handles preserving comments.
None of the code in this project has changed, and our tests still pass.

I'll look when I return from vacation next week. ✨
On Feb 27, 2015 2:34 AM, "Shijinyu" [email protected] wrote:

What a pity! It does be a very strange requirement what I had encountered.


Reply to this email directly or view it on GitHub
#82 (comment)
.

from gulp-uglify.

gideonstele avatar gideonstele commented on June 8, 2024

I'm very much obliged to you,enjoying your time.

from gulp-uglify.

terinjokes avatar terinjokes commented on June 8, 2024

I've just confirmed the proper option is being generated and passed to UglifyJS correctly. Can you reproduce the behavior calling their binary directly?

Also, I note the following from the --help screen:

Note that currently not *all* comments can be kept when
compression is on, because of dead code removal or
cascading statements into sequences. 

from gulp-uglify.

gideonstele avatar gideonstele commented on June 8, 2024

UglifyJS code is too complicated for me, I will try later but I'm not sure if I can reproduce. Thank you so much for making nothing of hardships to find out way and discuss this issue with me.

Go to bed early please. :-)

from gulp-uglify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.