gulp-require-file
Description
Processes 'require', 'require_directory', and 'require_tree' directives for inclusion of source files similar to Sprockets. Built with inspiration from gulp-include.
Installation
npm install --save-dev gulp-require-file
Usage
var gulp = requireFile = ; gulp; gulp;
Options
-
globOptions
(optional)Options that will be passed through to glob.sync. Can be used to customize the matching files to include.
Example:
// Ignore files with ".es6.js" extension
Supported Directives
require
Directive
The require
path inserts the contents of the asset source file
specified by path. If the file is required multiple times, it will
appear in the bundle only once.
require_directory
Directive
The require_directory
path requires all source files of the same
format in the directory specified by path. Files are required in
alphabetical order.
require_tree
Directive
The require_tree
path works like require_directory
, but operates
recursively to require all files in all subdirectories of the
directory specified by path.
Run Tests
cd path/to/gulp-require-file
npm install
npm test