标签:depend tran cal isp sas 任务 hidden for 功能
"devDependencies": {
"grunt": "^1.0.1"
}
插件名 |
---|
合并文件:grunt-contrib-concat |
语法检查:grunt-contrib-jshint |
Scss 编译:grunt-contrib-sass |
压缩文件:grunt-contrib-uglify |
监听文件变动:grunt-contrib-watch |
建立本地服务器:grunt-contrib-connect |
npm install --save-dev grunt-contrib-concat grunt-contrib-jshint grunt-contrib-sass grunt-contrib-uglify grunt-contrib-watch grunt-contrib-connect
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: {
expand:true,
//set source folder
cwd: ‘public/js/custom/‘,
src: ‘*.js‘,
//set destination folder
dest: ‘public/pjt/‘,
// ext: ‘.min.js‘
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks(‘grunt-contrib-uglify‘);
// Default task(s).
grunt.registerTask(‘default‘, [‘uglify‘]);
};
标签:depend tran cal isp sas 任务 hidden for 功能
原文地址:http://www.cnblogs.com/sylarmeng/p/6881750.html