Coder Social home page Coder Social logo

Comments (9)

shama avatar shama commented on September 13, 2024

Could you post your gruntfile and an example of the issue? Thanks!

from grunt-contrib-concat.

doomsbuster avatar doomsbuster commented on September 13, 2024

Please find the Gist below:
https://gist.github.com/doomsbuster/7475676

from grunt-contrib-concat.

shama avatar shama commented on September 13, 2024

Looking at your gruntfile it appears you're not using the concat task: https://gist.github.com/doomsbuster/7475676#file-gruntfile-js-L136

My guess is uglify is stripping your comments. Check out https://github.com/gruntjs/grunt-contrib-uglify#preservecomments for preserving comments.

from grunt-contrib-concat.

doomsbuster avatar doomsbuster commented on September 13, 2024

It's removing commenrs and also the first style .maincontainer. I am using con cat task in the concurrent area. Please advise.

Thanks,
Ashish Desai
www.ashishdesai.com

-------- Original message --------
From: Kyle ☱☲☳☴☵☷ ☶ Robinson ☱☲ [email protected]
Date:11/16/2013 12:28 PM (GMT-05:00)
To: gruntjs/grunt-contrib-concat [email protected]
Cc: Ashish Desai [email protected]
Subject: Re: [grunt-contrib-concat] Concat causes issues when the CSS has
multi-line comments at the beginning of the file (#51)

Looking at your gruntfile it appears you're not using the concat task: https://gist.github.com/doomsbuster/7475676#file-gruntfile-js-L136

My guess is uglify is stripping your comments. Check out https://github.com/gruntjs/grunt-contrib-uglify#preservecomments for preserving comments.


Reply to this email directly or view it on GitHub.

from grunt-contrib-concat.

shama avatar shama commented on September 13, 2024

According to the gruntfile you linked, there is no configuration for the concat task. You're using a different task.

from grunt-contrib-concat.

doomsbuster avatar doomsbuster commented on September 13, 2024

Here is the concat task. I have 3 CSS files and they are combined into one, concat task is being used. Also, it is removing the first style class if it begins with comments.
grunt.registerTask('build', [
'clean:dist',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngmin',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'rev',
'usemin'
]);

from grunt-contrib-concat.

shama avatar shama commented on September 13, 2024

Would you mind running grunt build --verbose and posting the result so I can see where the concat task is being ran? Thanks!

from grunt-contrib-concat.

doomsbuster avatar doomsbuster commented on September 13, 2024

Here are the logs:
https://gist.github.com/doomsbuster/7475676#file-gruntverboselogs

Please let me know if you need more information.

from grunt-contrib-concat.

shama avatar shama commented on September 13, 2024

Ah ha, you're right. You are using the concat task. I see it on this line: https://gist.github.com/doomsbuster/7475676#file-gruntverboselogs-L1065

I created a reduced example showing that the concat task doesn't naturally strip comments: https://gist.github.com/shama/84e57c994f5a14c3fa01

It appears another task is configuring the concat task for you likely with the stripBanners option set. I recommend configuring the concat task yourself rather than relying on other tasks.

I also recommend reducing the code in your Gruntfile to only the necessary parts for your project. Those Gruntfile generators are usually bloated and confusing because they are trying to handle too many use cases.

from grunt-contrib-concat.

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.