# gulp-pug-template-concat

> Compiles Pug (Jade) client side templates into a single file containing template functions

Latest version **1.1.1** (published 2018-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-pug-template-concat
pnpm add gulp-pug-template-concat
yarn add gulp-pug-template-concat
bun add gulp-pug-template-concat
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-04-14 |
| First published | 2016-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Pavel Rybin |
| Maintainers | drfisher |
| Keywords | gulp, pug, jade, client, template, concat |

## Links

- npm: https://www.npmjs.com/package/gulp-pug-template-concat
- Repository: https://github.com/drfisher/gulp-pug-template-concat
- Homepage: https://github.com/drfisher/gulp-pug-template-concat#readme
- Issues: https://github.com/drfisher/gulp-pug-template-concat/issues
- npm.io page: https://npm.io/package/gulp-pug-template-concat

## Dependencies (2)

- [through](https://npm.io/package/through.md) *
- [gulp-util](https://npm.io/package/gulp-util.md) *

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-04-14
- 1.1.0 — 2017-02-04
- 1.0.0 — 2016-07-16

## README

# gulp-pug-template-concat
Compiles Pug templates single file containing template functions. Supports commonJS.

Based on [gulp-jade-templates-concat](https://github.com/nStonehouse/gulp-jade-template-concat) by Nicholas Stonehouse.

## Install
```sh
$ npm install --save-dev gulp-pug-template-concat
```

## Usage
### Gulpfile
```javascript
var pug = require('gulp-pug');
var pugConcat = require('gulp-pug-template-concat');

gulp.task("client-templates", function(){
    gulp.src('src/pug/templates/**/*.pug')
        .pipe(pug({
            client: true
        })
        .pipe(pugConcat('mytemplates.js', {
            // uncomment to change templateVariable name. "templates" by default
            // templateVariable: "templates"
            
            // uncomment following line to export templates in commonJS manner
            // commonJS: true        
        }))
        .pipe(gulp.dest('build/templates/'))
});
```

This compiles all of your client side pug templates into a file called `mytemplates.js`.
The `templateVariable` option is optional and will default to `templates` if it is not set.


### HTML/Pug
Link the concatenated file with a script tag
```pug
script(src="templates/mytemplates.js")
```

### Javascript
Access the generated templates using dot or bracket access notation.
```javascript
  templates['template1'];
  templates.template2;
```

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