slushjs / slush-angular

A slush generator for AngularJS using the Google Angular App Structure Recommendations
129 stars 32 forks source link

HTML from vendor packages should be included in the compiled templates JS #30

Closed bguiz closed 10 years ago

bguiz commented 10 years ago

Currently the generated vendors task looks like this:

gulp.task('vendors', function () {
  var files = bowerFiles();
  var vendorJs = fileTypeFilter(files, 'js');
  var vendorCss = fileTypeFilter(files, 'css');
  var q = new queue({objectMode: true});
  if (vendorJs.length) {
    q.queue(gulp.src(vendorJs).pipe(dist('js', 'vendors')));
  }
  if (vendorCss.length) {
    q.queue(gulp.src(vendorCss).pipe(dist('css', 'vendors')));
  }
  return q.done();
});

Perhaps add HTML as well:

  var vendorHtml = fileTypeFilter(files, 'html');
  if (vendorHtml.length) {
    q.queue(gulp.src(vendorHtml).pipe(dist('html', 'vendors')));
  }

This doesn't work of course, because HTML requires an extra step, where JS is written to add it to the template cache. Unfortunately, I am not able to work out how that should be added.

bguiz commented 10 years ago

A "works for me" attempt at fixing this: https://github.com/slushjs/slush-angular/pull/31

joakimbeng commented 10 years ago

Closing this. Se reason in #31