gulp-file-assets
A gulp plugin to extract file assets.
Attention: Version 2.0.0+ is not compatible with 1.0.0+.
Usage
First, install gulp-file-assets
as a development dependency:
npm install --save-dev gulp-file-assets
Then, add it to your gulpfile.js
:
var gulp = ;var fileAssets = ; gulp;
Notice: If your source files are in a folder, please set the base
option of gulp.src(options)
to a right path.
Example
index.html
gulp-file-assets Link
style.css
gulpfile.js
var gulp = ;var fileAssets = ; gulp;// => ['dist/index.html', 'dist/css/style.css', 'dist/img/logo.png']
API
fileAssets(options)
options
Type: Object
options.exts
File extensions to be extracted.
Type: Array
Default:
'js' 'css' 'html' 'tpl' 'jpg' 'jpeg' 'png' 'gif' 'svg' 'webp' 'ttf' 'eot' 'otf' 'woff'
options.excludes
File extensions to be excluded.
Type: Array
Default: []
options.includeSrc
Whether to put the source files to the pipeline.
Type: Boolean
Default: true
options.depth
The depth of files to extract.
Type: Number
Default: null
options.ignores
A file path/RegExp list to be ignored.
Type: Array
Default: []