0.0.14 • Published 7 years ago

gulp-html2ts v0.0.14

Weekly downloads
2
License
MIT
Repository
github
Last release
7 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

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago