-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"grunt copy" command undoes minification process of "grunt build" command #185
Comments
Maybe check the order in which you execute your tasks. Sounds like copy runs before minification. Could you post your gruntfile? |
// Generated on 2014-03-30 using generator-angular 0.8.0 // # Globbing module.exports = function(grunt) {
}; |
I have moved the 'copy:dist' task to the bottom of the task list for "grunt build", just below "htmlmin", but that does not resolve the problem. |
Looks like the copy actions overwrite the already minified files with the original files. htmlmin: src: ['views/{,/}.html'] ---> dest: '<%= yeoman.dist %>' I'd suggest you perform copy as soon as possible. It will copy all files to the yeoman.dist directory. Of course you could also work the other way around, and let all the magic happen with your result in yeoman.dist. And after that use copy to copy the files in the yeoman.dist to the folder of your pleasing. |
Please mind the ''clean:dist'' action which removes all the files in yeoman.dist |
Okay, I've moved the copy action to be second in the list. First the dist folder must be cleaned (using the 'clean:dist' action). Everything is copied fine. I even added another task called 'copy:public', which copies my dist folder to a separate folder for my server's consumption, and I queued this task to occur last. Now that the files aren't being resized I'm happy. On to getting the missing background image to show. The background is defined in my CSS, so I think either the minification or sass precompiler may be the culprit. Everything loads fine on my dev machine, but who knows. Thanks for the help. |
Glad i could help! Regarding finding the missing bg. Maybe execute every task one-at-a-time and look when it goes wrong. |
Has anyone else noticed this? Found a work around?
Numerous files that have been compressed and shrunk jump to larger sizes after I run the grunt copy command. For example, my *.html file jumps from 7kb to 11kb.
Also, the minification process removes links to multiple style sheets and replaces them with a link to a single *.css style sheet (which is a minified combination of other style sheets). When I run grunt copy, specific files revert to their pre-minification state and suddenly I'm getting 404 errors for the previously mentioned pre-minified *.css files. When I look in the destination copy folder, the single minified, compressed *.css file is present.
Does anyone know of a good work around to this problem? I've been using a regular copy paste for the time being.
The text was updated successfully, but these errors were encountered: