0.0.14 • Published 6 years ago

gulp-html2ts v0.0.14

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

gulp-html2ts

This plugin filter html to typescript.

Input

MyView.html

<div>
</div>

Output

namespace a.b.c { export var MyView = `<div></div>`; }

Usage

With merge-stream and gulp-rename plugin, append htmls to typescript source set.

gulp.src('src/main/ts/**/*.ts')

In this case, FooBar.html filtered to _FooBar.html.ts

const mergeStream = require('merge-stream');
const rename = require('gulp-rename');
const html2ts = require('gulp-html2ts');

  ...

mergeStream(
  gulp.src('src/main/ts/**/*.ts'),
  gulp.src('src/main/ts/**/*.html')
    .pipe(html2ts() )
    .pipe(rename(function(path) {
      path.basename = '_' + path.basename;
      path.extname += '.ts';
    }) )
)
0.0.14

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago