0.2.2 • Published 9 years ago

gulp-assets v0.2.2

Weekly downloads
67
License
-
Repository
github
Last release
9 years ago

gulp-assets NPM version Build Status Coverage Status Dependency Status

assets plugin for gulp

Usage

First, install gulp-assets as a development dependency:

npm install --save-dev gulp-assets

Then, add it to your gulpfile.js:

var assets = require("gulp-assets");

gulp.src("./src/*.html")
	.pipe(assets({
		js: true,
        css: false
	}))
	.pipe(gulp.dest("./dist"));

API

assets(options)

options.js

Type: either a boolean or a string Default: true

Whether you wish to get javascript files. If a string is used, only the javascript files between the appropriate comment tags will be used.

Example:

<!-- build:myJsTag -->
<script src="js/foo.js"></script>
<!-- endbuild -->
assets({
    js: 'myJsTag',
    css: false
})

You will only get js/foo.js in your build stream

options.css

Type: either a boolean or a string Default: false

Whether you wish to get css files. If a string is used, only the css files between the appropriate comment tags will be used.

Example:

<!-- build:myCssTag -->
<link rel="stylesheet" href="css/foo.css"/>
<!-- endbuild -->
assets({
    js: false
    css: 'myCssTag',
})

options.cwd

Type: string Default: undefined

If set, will be used as a base when building the files' paths.

Shortcuts methods:

assets.js(<optional tagname>); // Only js files (between comment tags if tagname is set)
assets.css(<optional tagname>); // Only css files  (between comment tags if tagname is set)

Contributors

  • @kjbekkelund
  • @Zweer
  • @shinnn

License

MIT License

0.2.2

9 years ago

0.2.1

9 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago