nunjucks-minify-loaders

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i nunjucks-minify-loaders

Weekly Downloads

95

Version

1.0.2

License

BSD-2-Clause

Unpacked Size

6.5 kB

Total Files

7

Last publish

Collaborators

  • men232