Nearly Perfect Mediocracy

    gulp-gather

    0.0.2 • Public • Published

    gulp-gather

    Build Status

    Respecting micro-templating

    why

    spec

    Concat these .html fiels ...

    <!-- ./tpl/foo.html -->
    <a href="<%= url %>"><%= name %></a>
    <!-- ./tpl/bar/baz.html -->
    <% for ( var i = 0; i < users.length; i++ ) { %>
      <li><a href="<%=users[i].url%>"><%=users[i].name%></a></li>
    <% } %>

    To static pool like below

    this.MicroTemplates = {
        "tpl/foo.html": "<a href=\"<%= url %>\"><%= name %></a>",
        "tpl/bar/baz.html": "<% for ( var i = 0; i < users.length; i++ ) { %>
      <li><a href=\"<%=users[i].url%>\"><%=users[i].name%></a></li>
    <% } %>"
    };

    usage

    gulpfile.js

    var microtemplates = require('gulp-micro-templates');
    gulp.task('microt',function(){
        gulp.src('./tpl/**/*.html')
        .pipe(microtemplates('all.js'))
        .pipe(gulp.dest('./build/tpl'));
    });

    Keywords

    none

    Install

    npm i gulp-gather

    DownloadsWeekly Downloads

    4

    Version

    0.0.2

    License

    none

    Last publish

    Collaborators

    • otiai10