# gulp-include-sources

> Includes source files listed in HTML comments

Latest version **0.1.7** (published 2017-03-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-include-sources
pnpm add gulp-include-sources
yarn add gulp-include-sources
bun add gulp-include-sources
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2017-03-13 |
| First published | 2017-01-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gilles Meyer |
| Maintainers | babieldev |
| Keywords | templating, template, html, css, js, source, include, including |

## Links

- npm: https://www.npmjs.com/package/gulp-include-sources
- npm.io page: https://npm.io/package/gulp-include-sources

## Dependencies (5)

- [gulp](https://npm.io/package/gulp.md) ^3.9.1
- [extend](https://npm.io/package/extend.md) ^3.0.0
- [globby](https://npm.io/package/globby.md) ^6.1.0
- [through2](https://npm.io/package/through2.md) ^2.0.3
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.8

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.7 (latest) — 2017-03-13
- 0.1.6 — 2017-02-06
- 0.1.5 — 2017-02-03
- 0.1.4 — 2017-02-03
- 0.1.3 — 2017-02-03
- 0.1.2 — 2017-01-31

## README

This module helps you to include files, that you've listed in a simple HTML comment.
New files will be generated with the correct tags and files.

It's something like grunt-include-source

Example gulp task:

    const includeSource = require("gulp-include-sources");
    
    gulp.task("default", function(){
        return gulp.src("./test/src/*.html")   
            .pipe(includeSource())
            .pipe(gulp.dest("./test/dest/"));});
    }`


That's inside /src/index.html: 
`<!-- include: "type": "js", "files": ["scripts/test.js"] -->`

That's going to be generated (if the files exist): 
`<script src='scripts/test.js'></script>'`

When listed files are not found, the comment won't be replaced and you will get a warning in the console.

Default configuration:

    const DEFAULT_OPTIONS = {
        includesDir: "./",
        prefix: "<!-- ",
        suffix: " -->",
        debug: false,
        templates: {
            "js": '<script src="{filePath}"></script>',
            "css": '<link rel="stylesheet" type="text/css" href="{filePath}" />'
        }
    };

---
_Source: https://npm.io/package/gulp-include-sources · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
