Passing source from loader via html-minifier
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
FileMinifyLoader.js
LICENSE
README.md
index.js
package-lock.json
package.json

README.md

Nunjucks minifier loader

Simple module to passing source from loader via HTML minifier.

Installation

npm install nunjucks-minify-loaders

Using

var nunjucks = require('nunjucks');
var FileMinifyLoader = require('nunjucks-minify-loaders').FileMinifyLoader;
 
var opts = {
    // FileSystemLoader 
    watch: true,
    noCache: false,

    // html-minifier 
    minify: {
        removeComments: true,
        minifyJS: true,
    }
};

var loader = new FileMinifyLoader('./views', opts);
var env = new nunjucks.Environment(loader);

// Now every loaded templates from ./views will be handled via html-minifier

More about HTML-minifier