jonkemp / gulp-useref

Parse build blocks in HTML files to replace references to non-optimized scripts or stylesheets.
MIT License
705 stars 93 forks source link

gulp-useref: undefined is not a function #158

Closed spfiedler closed 8 years ago

spfiedler commented 8 years ago

I have been using gulp-useref 1.0.2 for a long time. But I have been having some trouble with IE comments being stripped out of my index file. I seemed to me that updating to a later version of gulp-useref (3.0.x) would be a good idea. However, when I try this, I get

[12:21:02] TypeError: undefined is not a function

Here the snippet from my gulp file: ... var assets = $.useref.assets();

return gulp.src('src/components/**/*.html')
  .pipe(assets)

...

It fails on the 'var' line

jonkemp commented 8 years ago

Please note the new syntax.

https://github.com/jonkemp/gulp-useref#usage

rwillmer commented 8 years ago

Related to #153

spfiedler commented 8 years ago

OK, thanks, I get that. However, I am trying to get the IE comments to be included as they are with node-useref, but have been unsuccessful at doing so. Is that feature include here?

jonkemp commented 8 years ago

Yes. It uses the same code.