gulp-closure-deps

0.4.0 • Public • Published

gulp-closure-deps

Build Status Dependency Status devDependency Status

Google Closure Library depswriter.py port for gulp

Install

npm install --save-dev gulp-closure-deps

Example

var gulp = require('gulp');
var closureDeps = require('gulp-closure-deps');
 
var paths = {
  scripts: [
    'bower_components/closure-library/closure/goog/**/*.js',
    'bower_components/este-library/este/**/*.js',
    'client/**/*.js',
    'server/**/*.js'
  ]
};
 
gulp.task('default', function() {
  gulp.src(paths.scripts)
    .pipe(closureDeps({
      fileName: 'deps.js',
      prefix: '../../../..',
      baseDir: 'public/'
    }))
    .pipe(gulp.dest('build'));
});

API

closureDeps(options)

options

fileName

Type: String
Default: deps.js

Generated file name.

prefix

Type: String
Default: ``

Path prefix for paths resolving, from Closure Library base.js to root.

baseDir

Type: String Default: ``

Optional base url for you public folder

methods

changed

Type: String
Returns: Boolean

This method can be used in watch mode. You can pass changed file path and it returns whether deps file should be recreated.

Error: EMFILE Issue

OSX has default limit for opened files set to 256. Fix it with ulimit -n 10000

License

MIT © Daniel Steigerwald

Package Sidebar

Install

npm i gulp-closure-deps

Weekly Downloads

976

Version

0.4.0

License

MIT

Last publish

Collaborators

  • steida