I have some css files which has 'jquery' as prefix. For example, 'jquery-fancybox.css'
I am using grunt cssmin to minify the css, and using a pre-commit git hook, i am able to run the minifying.
I did a post-receive git hook on the server as well, so when i do a pull, it does the minifying as well.
When I am doing the pre-commit git hook, those css files with prefix 'jquery' can be minified, but not in the post-receive git hook.
Any idea why?
My grunt file is as below
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
files: [{
expand: true,
src: '**/*.js',
dest: 'resources/front/js',
cwd: 'assets/front/js'
}]
}
},
cssmin: {
minify: {
files: [{
expand: true,
cwd: 'assets/front/css/',
src: ['*.css', '!*.min.css'],
dest: 'resources/front/css/',
ext: '.css'
}, {
expand: true,
cwd: 'assets/front/css/',
src: ['*.min.css'],
dest: 'resources/front/css/',
ext: '.min.css'
}]
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
// Default task(s).
grunt.registerTask('default', ['cssmin']);
};
grunt cssmin
manually after pulling down new code? We need to isolate whether this is a grunt task issue or a gitpost-receive
issue. – Jordan Kasper