标签:
{
"name": "xcwJs",
"version": "0.1.0",
"description": "xcwJs",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-uglify": "~0.2.1",
"grunt-contrib-requirejs": "~0.4.1",
"grunt-contrib-concat": "~0.1.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-strip": "~0.2.1"
},
"dependencies": {
"express": "3.x"
}
}
module.exports = function (grunt) { // ÏîÄ¿ÅäÖà grunt.initConfig({ pkg: grunt.file.readJSON(‘package.json‘), concat: { options: { separator: ‘;‘ }, dist: { //要合并的文件 src: [‘src/addfavor.js‘, ‘src/arrayHelp.js‘, ‘src/common.js‘,‘src/convertor.js‘,‘src/slider.js‘,‘src/star.js‘,‘src/vTicker.js‘], dest: ‘dest/xcw.js‘//将文件合并到dest下 } }, uglify : { options : { //压缩文件的头部说明 banner : ‘/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n‘ }, build : { src : ‘dest/xcw.js‘, dest : ‘dest/xcw.min.js‘ } } }); // 载入concat和uglify插件,分别对于合并和压缩 grunt.loadNpmTasks(‘grunt-contrib-concat‘); grunt.loadNpmTasks(‘grunt-contrib-uglify‘); // 注册任务 grunt.registerTask(‘default‘, [‘concat‘, ‘uglify‘]); }
标签:
原文地址:http://www.cnblogs.com/fangdx/p/4565165.html