The following script concatenate and minify css and js correctly.
I need to copy in my build directory some foldersa and their files and some other files from root (without minification or concatenation).
Example are folder icons
(subfolder included if possible), images
, and config.xml in root.
Any idea how to change the script?
module.exports = function (grunt) {
// project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/* App: <%= pkg.name %> - Version: <%= pkg.version %> - Date: <%= grunt.template.today("dd-mm-yyyy") %> - Author: <%= pkg.author %> */\n\n'
}
},
cssmin: {
options: {
banner: '/* App: <%= pkg.name %> - Version: <%= pkg.version %> - Date: <%= grunt.template.today("dd-mm-yyyy") %> - Author: <%= pkg.author %> */\n'
}
},
useminPrepare: {
html: 'index.html',
options: {
dest: 'build'
}
},
usemin: { html: ['build/index.html'] },
copy: {
task0: {
src: 'index.html',
dest: 'build/index.html'
}
}
});
// load required modules
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-usemin');
// task definitions
grunt.registerTask('build', [
'copy:task0',
'useminPrepare',
'concat',
'cssmin',
'uglify',
'usemin'
]);
};