Skip to content

useref not finding flag after html compiled #2

@melissawood

Description

@melissawood

Hi!

This isn't really an issue needing resolve, however I thought this would be super useful for others.

Love this little Gulp plugin - great for HTML management when the introduction of something like Mustache or Handlebars isn't an option.

I came across an issue when using this plugin and useref. All it took to fix it was to clean up the line endings after you've run it. Suspect this is likely to be more of a problem for those with a windows / sublime combo.

However, install gulp-line-ending-corrector, require and use it in your task like this:

gulp.task('html-partials', function () {
	return gulp.src('app/html/*.html')
	.pipe(htmlPartial({
		basePath: 'app/html/'
	}))
	.pipe(lec({verbose:true, eolc: 'LF', encoding:'utf8'})) // clean up line endings for useref to find flags
	.pipe(gulp.dest('dist'))
	.pipe(livereload());
});

Bosh! useref works just fine and dandy and able to find your flags. Hope it helps others along the way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions