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

set also file.base when options.base is provided #192

Closed jimmytheneutrino closed 8 years ago

jimmytheneutrino commented 8 years ago

This fixes the problem: For example, if an html in a subdir references some css-s. You expect the html to end up in a js template (on the root level) and the concatenated css on the root level, not in a subdir. If you rely on vinyl's basepath, it is currently very hard to do.

(Well, of course, as a workaround you can pipe, e.g., with through2-spy and set file.base manually.)

In general, this seems like a sane thing to do, anyway.

jonkemp commented 8 years ago

Can you provide a test that shows this?

jimmytheneutrino commented 8 years ago

Added tests. Note that gulp.dest uses relative paths, the test in mock.relative.js tests that it works correctly when the base is specified.

jonkemp commented 8 years ago

Looks good. Can you squash commits?

jimmytheneutrino commented 8 years ago

Done.