Comments (9)
Could you post your gruntfile and an example of the issue? Thanks!
from grunt-contrib-concat.
Please find the Gist below:
https://gist.github.com/doomsbuster/7475676
from grunt-contrib-concat.
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.
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.
According to the gruntfile you linked, there is no configuration for the concat
task. You're using a different task.
from grunt-contrib-concat.
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.
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.
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.
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)
- how to read more than one files by using wildcard? HOT 1
- Remove peerDeps HOT 1
- relative url in css/js file
- stripBanners is backwards
- Snap-Ci concat.generated config error HOT 1
- File ordering changed since update?
- d in grunt
- node 7.0.0 breaks task
- JS Stacktrace Crash on SourceMaps HOT 1
- Please either add css concatenation support, or mention in the documentation that it is impossible with this tool
- Cannot convert undefined or null to object when npm install.
- Unable to concatenate file with multiple sourcemaps HOT 3
- concat in specific order; not alphabetically HOT 1
- Concatenating files that end in comments adds the first line of new files as comments too
- Concat only works with 'files' object HOT 1
- Concat minified files with source map results in line offset HOT 1
- update for source-map 0.7.x HOT 2
- Upgrade Chalk HOT 1
- Is it possible to map error traces back to source files?
- options.process undefined, even though it's not HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-contrib-concat.