gulp4-html2js

0.5.1 • Public • Published

gulp4-html2js

NPM version Downloads

Fork for gulp-html2js package. Resolved all vulnerabilities, removed depricated gulp-utils. Gulp v4 plugin for converting AngularJS templates to JavaScript

See more from grunt-html2js

Install

Install with npm npm install --save-dev gulp4-html2js

Usage

Angular

var gulp = require('gulp');
var html2js = require('gulp4-html2js');

gulp.task('default', function () {
    gulp.src('templates/*.html')
        .pipe(html2js('angular.js', {
            adapter: 'angular',
            base: 'templates',
            name: 'angular-demo'
        }))
        .pipe(gulp.dest('dist/'));
});

Vanilla

var gulp = require('gulp');
var html2js = require('gulp4-html2js');

gulp.task('default', function () {
    gulp.src('templates/*.html')
        .pipe(html2js('js-demo.js', {
            adapter: 'javascript',
            base: 'templates',
            name: 'js-demo'
        }))
        .pipe(gulp.dest('dist/'));
});

Available options

  • base - project source path default to "."
  • quoteChar - default to "
  • indentString - default to " " (two spaces)
  • target (coffee support to be added)
  • useStrict - default to false
  • name - module name

LICENSE

(MIT License)

Copyright (c) 2015 Fraserxu xvfeng123@gmail.com

Readme

Keywords

Package Sidebar

Install

npm i gulp4-html2js

Weekly Downloads

0

Version

0.5.1

License

MIT

Unpacked Size

11.8 kB

Total Files

13

Last publish

Collaborators

  • russelomua