npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-toor

v0.2.2

Published

gulp plugin to package all require.js files

Downloads

5

Readme

Gulp-Toor

npm npm

用途

Gulp插件,使用r.js(require.js)打包目录下所有require.js文件。

特点

  • 支持多入口文件同时编译优化
  • 支持缓存,增量编译优化(非稳定特性)

使用方法

gulp.task('test',function(){
	gulp.src(['myapp/**/*.js'],{
		base:'myapp' //设定相对目录,在输出时myapp之后的路径会保留
	}).pipe(toor(
		cache:{
			enable:true, //开启缓存,下次只编译有变更的文件
            debug:true, //开启调试模式,会输出更多信息
			cachePath:'./.gulp-toor-cache', //缓存文件存放目录
			dest:'web/scripts-build' //优化后输出文件所在目录
		},
		requireConfig:{
			baseUrl:'myapp',	//require.js模块根目录

			//一些require.js配置,比如package/paths/shim等
			packages:[{
				name: 'echarts',
				location: 'lib/echarts',
				main: 'echarts'
			},{
				name: 'zrender',
				location: 'lib/zrender', // zrender与echarts在同一级目录
				main: 'zrender'
			}],
			paths:{
				jquery:'lib/jquery'
			},
			shim: {
				'lib/modernizr': {
					exports: 'Modernizr'
				},
				'lib/jquery':{
					exports: 'jQuery'
				}
			},
			exclude:['jquery']
		}
	})).pipe(gulp.dest('myapp-build'))	//输出目录,后面会接上源文件myapp之后的路径
		.on('error',function(err){
		console.log(err);	//输出错误(gulp插件会触发错误事件,但不会输出,需要手工处理)
	})
});

版本

0.2.2 (2016-03-15)

  • 出错时直接使用console.log打印错误

0.2.1 (2015-09-21)

  • 修正package.json中madge依赖声明(非稳定特性)

0.2.0 (2015-09-21)

  • 增加缓存增量编译优化功能(非稳定特性)

0.1.3 (2015-09-11)

  • 修复windows下模块名称错误的问题

0.1.2 (2014-12-26)

  • 去掉require.js写文件的步骤,返回gulp标准流
  • 采用gulp方式规整日志输出

0.1.1 (2014-12-11)

  • 修正对多级目录模块的支持

0.1.0 (2014-11-13)

  • 初始发布