• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ladjs/gulp-jade-usemin: Gulp plugin for running usemin on Jade files

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ladjs/gulp-jade-usemin

开源软件地址(OpenSource Url):

https://github.com/ladjs/gulp-jade-usemin

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

gulp-jade-usemin

Replaces references to non-optimized scripts or stylesheets into a set of Jade files (or any templates/views).

This task is designed for gulp 3.

Attention: v0.3.0 options does not compatible with v0.2.0.

Usage

First, install gulp-jade-usemin as a development dependency:

npm install --save-dev gulp-jade-usemin

Then, add it to your gulpfile.js:

var usemin = require('gulp-jade-usemin');
var uglify = require('gulp-uglify');
var minifyHtml = require('gulp-minify-html');
var minifyCss = require('gulp-minify-css');
var rev = require('gulp-rev');

gulp.task('usemin', function() {
  gulp.src('./*.jade')
    .pipe(usemin({
      css: [minifyCss(), 'concat'],
      html: [minifyHtml({empty: true})],
      js: [uglify(), rev()]
    }))
    .pipe(gulp.dest('build/'));
});

Sample usage in Jade file:

//- build:css /css/app.css
block stylesheets
  link(rel='stylesheet', href='/css/style.css')
//- endbuild

//- build:js /js/app.js
block scripts
    script(src='/js/script1.js')
    script(src='/js/script2.js')
//- endbuild

Changelog

1.1.2

  • added maxListeners option (for setting the maximum number of listeners for streams)
  • added outputRelativePath and outputBasePath option, it makes possible to use absolute routes to static files in jade templates independently to the folder structure of views

1.1.1

  • fixed stream error issue

1.1.0

  • fixed RegExp issue, now requires you to have a / or . as first character in your rev replacement (e.g. you need to have relative or absolute paths via script(src='/foo.js') as opposed to script(src='foo.js'))

1.0.0

  • added video and img support
  • support append and prepend
  • jade style syntax

0.0.1

  • initial release



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
sindresorhus/gulp-markdown-pdf: Markdown to PDF发布时间:2022-06-21
下一篇:
AvraamMavridis/gulp-louis: Gulp task to analyze website performance.发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap