常用gulp插件介绍

一、gulp-useref:对html页面中的js,css引用进行简单的合并、压缩。

二、gulp-load-plugins:让当前文件自动加载package.json文件里的gulp插件。

三、gulp-angular-templatecache:将指定的HTML模板文件以JS字符串的形式注册在(Angular自带的)$tempalteCache服务中。

四、gulp-htmlmin:对html页面中的js,css引用进行(去除页面空格、注释,删除多余属性等)复杂的合并、压缩。

http://pinkyjie.com/2015/08/02/commonly-used-gulp-plugins-part-1/
http://pinkyjie.com/2015/08/12/commonly-used-gulp-plugins-part-2/#more
另 、gulp插件之gulp-autoprefixer:根据设置浏览器版本自动处理浏览器前缀。
1、基本使用

2、gulp-autoprefixer的browsers参数详解:
https://github.com/browserslist/browserslist#queries
You can specify the browser and Node.js versions by queries (case insensitive):

5%: browsers versions selected by global usage statistics. >=, < and <= work too.
5% in US: uses USA usage statistics. It accepts two-letter country code.
5% in alt-AS: uses Asia region usage statistics. List of all region codes can be found at caniuse-lite/data/regions.
5% in my stats: uses custom usage data.
cover 99.5%: most popular browsers that provide coverage.
cover 99.5% in US: same as above, with two-letter country code.
cover 99.5% in my stats: uses custom usage data.
maintained node versions: all Node.js versions, which are still maintained by Node.js Foundation.
node 10 and node 10.4: selects latest Node.js 10.x.x or 10.4.x release.
extends browserslist-config-mycompany: take queries from browserslist-config-mycompany npm package.
ie 6-8: selects an inclusive range of versions.
Firefox > 20: versions of Firefox newer than 20. >=, < and <= work too.
iOS 7: the iOS browser version 7 directly.
Firefox ESR: the latest [Firefox ESR] version.
unreleased versions or unreleased Chrome versions: alpha and beta versions.
last 2 major versions or last 2 iOS major versions: all minor/patch releases of last 2 major versions.
since 2015 or last 2 years: all versions released since year 2015 (also since 2015-03 and since 2015-03-10).
dead: browsers from last 2 version query, but with less than 0.5% in global usage statistics and without official support or updates for 24 months. Right now it is IE 10, IE_Mob 10, BlackBerry 10, BlackBerry 7, and OperaMobile 12.1.
last 2 versions: the last 2 versions for each browser.
last 2 Chrome versions: the last 2 versions of Chrome browser.
defaults: Browserslist’s default browsers (> 0.5%, last 2 versions, Firefox ESR, not dead).
not ie <= 8: exclude browsers selected by previous queries.
You can add not to any query.

另、browser-sync:让浏览器实时响应文件更改、自动刷新页面。

评论 ( 0 )
最新评论
暂无评论

赶紧努力消灭 0 回复