grunt
来源:互联网 发布:算法高清完整版pdf 编辑:程序博客网 时间:2024/04/30 10:56
time-grunt
用途:列出当前每个执行任务所需要的时间
使用方法
require(‘time-grunt’)(grunt)
load-grunt-tasks
用途:加载当前项目需要的是所有依赖项,取代以前grunt.loadNpmTask('grunt-contrib-watch')
这种繁琐的声明方式
使用方法
require(‘load-grunt-tasks’)(grunt)
module.exports=function(grunt){ require('load-grunt-tasks')(grunt); grunt.initConfig({ pkg:grunt.readJSON('package.json'), connect:{ options:{ port:9000, open:true, livereload:35729, hostname:'localhost' }, livereload:{ options:{ middleware:function(connect){ return [ connect.static('.tmp'),//将.tmp下的内容添加到根路径的路径匹配 connect.use('/bower_compontents',connect.static('./bower_compontents')),//指定新的路径匹配 connect.static('app')//将app下的内容添加到根路径的路径匹配 ] } } } }, wiredep:{ app:{ ignorePath:/^\/|\.\.\//, src:['app/index.html'], exclude:['bower_compontents/bootstrap-sass-official/assets/bootstrap.js'] }, sass:{ src:['app/styles/{,*/}*.{scss,saaa}'], ignorePath:/(\.\.\/){1,2}bower_compontents\// } }, watch:{ bower:{ files:['bower.json'], tasks:['wiredep'] }, js:{ files:['app/scripts/{,*/}*.js'] tasks:['jshint'], options:{ livereload:true } }, gruntfile:{ files:['Gruntfile.js'] }, sass:{ files:['app/styles/{,*/}*.{scss,sass}'], tasks:['sass:server','autoprefixer'] }, styles:{ files:['app/styles/{,*/}*.css'], tasks:['newer:copy:styles','autoprefixer'] }, livereload:{ options:{ livereload:'<%= connect.options.livereload %>' } files:[ 'app/{,*/}*.html', '.tmp/styles/{,*/}*.css', 'app/images/{,*/}*' ], } } }); require('time-grunt')(grunt);}
常用插件
grunt-contrib-copy
grunt-contrib-clean
grunt-contrib-watch
grunt-contrib-sass
grunt-contrib-connect //在本地启用 server
grunt-spritesmith
wiredep自动引用bower中下载的js和css文件到指定的html文件中
concurrent:server//并行执行task
0 0
- grunt
- grunt
- Grunt
- Grunt
- grunt
- grunt
- Grunt
- grunt
- Grunt
- grunt
- Grunt
- grunt
- grunt教程--初涉grunt
- grunt教程-安装grunt
- Grunt-Grunt使用
- 【Grunt】Grunt打包入门
- 【Grunt】Grunt打包流程
- grunt js
- HihoCoder
- -JAVA-堆栈详解
- java 变量
- Redhat7.0下系统延迟及定时机制
- 【矩阵快速幂】
- grunt
- ZOJ3703-Happy Programming Contest
- 简明Python基础教程一
- app打包上架
- linux 自动获取FTP服务器文件shell
- Linux系统--常用压缩/解压缩命令总结
- arm芯片,远程空中升级程序技术方案
- Java内存机制以及Android内存优化
- [HDU4010]Query on The Trees-动态树LCT(Link Cut Tree)