No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
node_modules
test
.gitattributes
.npmignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

Converts HTML files into JavaScript files and populates them into a variable "htmlTemplates" in the global namespace.

Example usage of this is while using angular-router:

template: htmlTemplates['/path/to/file.html']

> 
> This is essentially a derivative of Mark Lagendijk's gulp-ng-html2js

## Usage

First, install `gulp-jsify-html-templates` as a development dependency:

```shell
npm install --save-dev gulp-jsify-html-templates

Then, add it to your gulpfile.js:

var jsifyTemplates = require('gulp-jsify-html-templates');

gulp.task('jsifyTemplates', function() {
  gulp.src('partials/*.html')
    .pipe(jsifyTemplates({
        prefix: '/partials/'
    }))
    .pipe(gulp.dest('dist'))
});

Options

  • prefix

    Pass a string if you wish to prepend a string to the filename in the htmlTemplates object.

  • stripPrefix

    Pass a stringi fyou wish to subtract from the file path to generate the file url.

License

MIT License