Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scniro/gulp-angular-tpl2js
Use gulp to convert Angular templates to inline JavaScript
https://github.com/scniro/gulp-angular-tpl2js
Last synced: about 1 month ago
JSON representation
Use gulp to convert Angular templates to inline JavaScript
- Host: GitHub
- URL: https://github.com/scniro/gulp-angular-tpl2js
- Owner: scniro
- License: mit
- Created: 2016-03-21T19:01:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-30T18:40:39.000Z (over 7 years ago)
- Last Synced: 2024-10-03T23:54:59.322Z (about 1 month ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-angular-tpl2js
[![Build Status](https://img.shields.io/travis/scniro/gulp-angular-tpl2js.svg?style=flat-square)](https://travis-ci.org/scniro/gulp-angular-tpl2js)
[![NPM Version](https://img.shields.io/npm/v/gulp-angular-tpl2js.svg?style=flat-square)](https://www.npmjs.com/package/gulp-angular-tpl2js)
[![Dependency Status](https://img.shields.io/david/scniro/gulp-angular-tpl2js.svg?label=deps&style=flat-square)](https://david-dm.org/scniro/gulp-angular-tpl2js)
[![devDependency Status](https://img.shields.io/david/dev/scniro/gulp-angular-tpl2js.svg?label=devDeps&style=flat-square)](https://david-dm.org/scniro/gulp-angular-tpl2js#info=devDependencies)
[![Coverage](https://img.shields.io/coveralls/scniro/gulp-angular-tpl2js.svg?style=flat-square)](https://coveralls.io/github/scniro/gulp-angular-tpl2js)
[![Climate](https://img.shields.io/codeclimate/github/scniro/gulp-angular-tpl2js.svg?label=climate&style=flat-square)](https://codeclimate.com/github/scniro/gulp-angular-tpl2js)> Inject AngularJS directive templates as inline JavaScript using [gulp](http://gulpjs.com/)
## Regarding Issues
This is just a simple [gulp plugin](http://gulpjs.com/plugins/), which means it's nothing more than a thin wrapper around [angular-tpl2js](https://github.com/scniro/angular-tpl2js). If it looks like you are having issues, please [open an issue at angular-tpl2js](https://github.com/scniro/angular-tpl2js/issues). Only create a new issue if it looks like you're having a problem with the plugin itself.
## Install
```
npm install gulp-angular-tpl2js --save-dev
```## API
### tpl2js([*config*])
```javascript
var gulp = require('gulp');
var tpl2js = require('gulp-angular-tpl2js');gulp.task('inline', function() {
return gulp.src('/js/directives/*.js')
.pipe(tpl2js())
.pipe(gulp.dest('/dest'));
});
```#### config
`include` for retrieving [ng-include](https://docs.angularjs.org/api/ng/directive/ngInclude) templates and `HTMLMinifier`, a relay for [html-minifier](https://www.npmjs.com/package/html-minifier) options
```javascript
// defaults
var config = {
include: false,
HTMLMinifier: {
collapseWhitespace: true,
removeComments: true
}
}
```***
```javascript
var gulp = require('gulp');
var tpl2js = require('gulp-angular-tpl2js');gulp.task('inline', function() {
return gulp.src('/js/directives/*.js')
.pipe(tpl2js({include: true})) // ng-include parsed
.pipe(gulp.dest('/dest'));
});
```