Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acombes/gulp-nunjucks-inheritance
Recompile only changed Nunjucks files and their dependencies (included, extended, or imported).
https://github.com/acombes/gulp-nunjucks-inheritance
Last synced: 4 days ago
JSON representation
Recompile only changed Nunjucks files and their dependencies (included, extended, or imported).
- Host: GitHub
- URL: https://github.com/acombes/gulp-nunjucks-inheritance
- Owner: Acombes
- License: mit
- Created: 2019-04-04T15:46:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-26T14:15:15.000Z (over 5 years ago)
- Last Synced: 2024-12-15T09:40:49.906Z (8 days ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-nunjucks-inheritance
Recompile only changed Nunjucks files and their dependencies (included, extended, or imported).## Installation
```bash
npm i gulp-nunjucks-inheritance
```## Usage
Suggest to work with [gulp-nunjucks](https://www.npmjs.com/package/gulp-nunjucks) and [gulp-cached](https://www.npmjs.com/package/gulp-cached).
```javascript
var gulp = require('gulp');
var nunjucksInheritance = require('gulp-nunjucks-inheritance');
var nunjucks = require('nunjucks');
var cached = require('gulp-cached');
gulp.task('html', function() {
return gulp.src('src/nunjucks/**/*.njk')
//filter out unchanged NJK files
.pipe(cached('njk'))
//find files that use the files that have changed
.pipe(nunjucksInheritance({base: 'src/nunjucks'}))
//process scss files
.pipe(nunjucks.compile())
//save all the files
.pipe(gulp.dest('dist'));
});
```