grunt.initConfig({
concat: {
sample: {
options: {
banner: ‘/* <%= baz %> */\n‘, // ‘/* abcde */\n‘
},
src: [‘<%= qux %>‘, ‘baz/*.js‘], // [[‘foo/*.js‘, ‘bar/*.js‘], ‘baz/*.js‘]
dest: ‘build/<%= baz %>.js‘, // ‘build/abcde.js‘
},
},
//用于任务配置模板的任意属性
foo: ‘c‘,
bar: ‘b<%= foo %>d‘, // ‘bcd‘
baz: ‘a<%= bar %>e‘, // ‘abcde‘
qux: [‘foo/*.js‘, ‘bar/*.js‘],
});
grunt.initConfig({
pkg: grunt.file.readJSON(‘package.json‘),
uglify: {
options: {
banner: ‘/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n‘
},
dist: {
src: ‘src/<%= pkg.name %>.js‘,
dest: ‘dist/<%= pkg.name %>.min.js‘
}
}
});
转载:http://www.gruntjs.net/configuring-tasks
原文:http://www.cnblogs.com/ayseeing/p/4649014.html