Skip to content

Added debugIncludes param to echo included filenames to console #74

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Changelog

#### 2.4.1
* Added `debugIncludes` param

#### 2.4.0
* Lots of community fixes graceously assembled and merged by [KenEucker](https://github.com/KenEucker)
* Dependencies update after three years.
* The plugin now supports both gulp 3 and gulp version 4.
* Merged support for separated includes between files, by [PFight](https://github.com/PFight)

#### 2.3.1
* Isolated include to solve some scoping issues that happens when running multiple includes in parallel.
Expand Down
41 changes: 31 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
#gulp-include [![NPM version][npm-image]][npm-url] ![Travis build][travis-image]
>Makes inclusion of files a breeze.
Enables functionality similar to that of snockets / sprockets or other file insertion compilation tools.

> Made for gulp 3
# gulp-include [![NPM version][npm-image]][npm-url] ![Travis build][travis-image]

<table>
<tr>
<td>Package</td><td>gulp-include</td>
</tr>
<tr>
<td>Description</td>
<td>Makes inclusion of files a breeze. Enables functionality similar to that of snockets / sprockets or other file insertion compilation tools.</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 6.0.0 </td>
</tr>
<tr>
<td>Gulp Version</td>
<td>>= 3.0.0</td>
</table>

> Works with gulp 3 and gulp 4

## Features
* Concatenate files with full control
Expand Down Expand Up @@ -35,13 +50,13 @@ gulp.task("default", ["scripts"]);

## Options
- `extensions` (optional)
* Takes a `String` or an `Array` of extensions.
* Takes a `String` or an `Array` of extensions.
eg: `"js"` or `["js", "coffee"]`
* If set, all directives that does not match the extension(s) will be ignored
* If set, all directives that does not match the extension(s) will be ignored


- `includePaths` (optional)
* Takes a `String` or an `Array` of paths.
* Takes a `String` or an `Array` of paths.
eg: `__dirname + "/node_modules"` or `[__dirname + "/assets/js", __dirname + "/bower_components"]`
* If set, `gulp-include` will use these folders as base path when searching for files.

Expand All @@ -58,6 +73,11 @@ gulp.task("default", ["scripts"]);
So, if file required several times inside one file (or inside required by it files), then dublicates will be ignored.
But when another file will begin processing, all information about required files from previuos file will be discarded.


- `debugIncludes` (optional)
* Boolean, `false` by default
* Set this to `true` if you want `gulp-include` to output included filenames to the console.

#### Example options usage:
```js
gulp.src("src/js/main.js")
Expand All @@ -67,7 +87,8 @@ gulp.src("src/js/main.js")
includePaths: [
__dirname + "/bower_components",
__dirname + "/src/js"
]
],
debugIncludes: true
}))
.pipe(gulp.dest("dist/js"));
```
Expand All @@ -94,7 +115,7 @@ Example directives:
The contents of the referenced file will replace the file.

### `require` vs. `include`
A file that is included with `require` will only be included if it has not been included before. Files included with `include` will _always_ be included.
A file that is included with `require` will only be included if it has not been included before. Files included with `include` will _always_ be included.
For instance, let's say you want to include `jquery.js` only once, and before any of your other scripts in the same folder.
```javascript
//=require vendor/jquery.js
Expand Down
Loading