browserify-ng-htmlmin2js

0.1.0 • Public • Published

browserify-ng-htmlmin2js

Browserify transform to minify and compile angular templates into angular modules. Based on browserify-ng-html2js

$ npm install browserify-ng-htmlmin2js --save-dev

Usage

Pass a configured ngHtmlMin2Js instance as a browserify transform.

var browserify = require('browserify');
var gulp = require('gulp');
var ngHtmlMin2Js = require('browserify-ng-htmlmin2js');
var source = require('vinyl-source-stream');

gulp.task('scripts', function () {
  return browserify('./src/app.js')
    .transform(ngHtmlMin2Js({
      module: 'templates', // optional module name
      extension: 'ngt', // optionally specify what file types to look for
      baseDir: "src/js", // optionally specify base directory for filename
      prefix: '', // optionally specify a prefix to be added to the filename
      minify: { // optionally specify options to pass to html-minifier
        collapseWhitespace: true,
        removeComments: true
      } // leave undefined to disable minification
    }
    }))
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(gulp.dest('./dist'));
});

Readme

Keywords

none

Package Sidebar

Install

npm i browserify-ng-htmlmin2js

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • c9r