前端自动化工具grunt介绍
来源:互联网 发布:d3.js 颜色渐变 编辑:程序博客网 时间:2024/05/17 04:33
grunt已过时,请看我的关于gulp的教程
教程链接:http://developer.51cto.com/art/201506/479127.htm
目录结构:
Gruntfile.js >>
module.exports = function(grunt) { //任务配置,所有插件的配置信息 grunt.initConfig({ //获取package.json的信息 pkg: grunt.file.readJSON('package.json'), //uglify插件的配置信息 uglify: { options: { stripBanners: true, banner: '/*! <%=pkg.name%>-<%=pkg.version%>.js <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, build: { src: 'src/base.js', dest: 'build/<%=pkg.name%>-<%=pkg.version%>.js.min.js' } }, //jshint插件的配置信息 jshint: { options: { jshintrc: '.jshintrc'//此文件需要是ANSI编码 }, build: ['Gruntfile.js', 'src/*.js'] }, watch: { build: { files: ['src/*.js', 'src/*.css'], tasks: ['jshint', 'uglify'], options: { spawn: false } } } }); //告诉grunt我们将使用插件 grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); //告诉grunt当我们在终端输入grunt时需要做些什么 grunt.registerTask('default', ['jshint', 'uglify', 'watch']);};package.json >>
{ "name": "grunt_test", "version": "1.0.0", "devDependencies": { "grunt": "^1.0.1", "grunt-contrib-jshint": "^1.0.0", "grunt-contrib-uglify": "^2.0.0", "grunt-contrib-watch": "^1.0.0" }}.jshintrc >>
{"boss": false,"curly": true,"eqeqeq": true,"eqnull": true,"expr": true,"immed": true,"newcap": true,"noempty": true,"noarg": true,"undef": true,"regexp": true,"browser": true,"devel": true,"node": true}
0 0
- 前端自动化工具grunt介绍
- 前端自动化工具grunt
- Grunt前端自动化工具
- 前端自动化构建工具Grunt
- grunt-beginner 前端自动化工具
- Grunt-beginner前端自动化工具
- 【Grunt】前端自动化构建工具
- 前端自动化构建工具Grunt
- grunt 前端自动化构建工具
- 前端开发自动化工作流工具,JavaScript自动化构建工具grunt、gulp、webpack介绍
- javascript前端工具------自动化构建工具Grunt
- 一步一步学习安装Grunt前端自动化工具
- 前端自动化工具Grunt的使用
- Grunt自动化web前端开发环境工具
- 前端自动化工具grunt的使用
- 前端自动化Grunt教程
- Grunt教程-前端自动化
- Grunt教程-前端自动化
- java中+=是什么意思
- MTK Android 5.0以上版本的变化
- OpenCV中mat::copyto( )函数使用方法
- mysql 5.7.14安装成功
- JQ点击展开二级菜单
- 前端自动化工具grunt介绍
- HDOJ-【Gym Class】
- 【MySQL】数据库操作基础笔记
- 巧妙解决Unable to delete directory: 盘符\项目名称\app\build\output\apk
- C++01背包-装箱问题
- HDU Problem 5636 Shortest Path 【Floyd】
- POJ 3420 Quad Tiling(轮廓线DP+矩阵快速幂)
- 英国安全公司高管承认攻击对手公司
- React Native商城项目实战11 - 个人中心头部内容