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

Complex build paths fail in 1.3.0, resulting source dropped #137

Closed sachasayan closed 8 years ago

sachasayan commented 8 years ago

Hey Jon,

First of all, thanks for gulp-useref. We're using it in production for certain projects over here at FreshBooks, and we really like it!

We've noticed there's a regression, however, as of 1.3.0. In certain circumstances of say, concatenating js, useref will, as best we can tell:

1) correctly determine the paths 2) correctly (internally) determine what the output should be 3) correctly determine what the markup should be... 4) output the markup

However, it will NOT output the destination (concatenated) file.

It looks like 1.2.0 is not affected by this issue, so this should be a recent (1.3.0) regression.

I've put a quick proof over at https://github.com/ssayan/break-gulp-useref

To replicate/run: 1) npm install. Useref is pinned at 1.2.0 by default in the package.json. 2) Run gulp js-concat. You should correctly see some output HTML generated in /concatenated-html, and a combined-globals.js in /js/concat. 3) Reset, and change useref to version 1.3.0 4) Run gulp js-concat again. The html is generated, but the concatenated js is dropped.

No fix from my end yet, but wanted to throw up an issue. Any comments?

jonkemp commented 8 years ago

Can you clone this repo and then link it to your project to see if my latest changes fix it?

jonkemp commented 8 years ago

The plugin was updated recently. Can you test against the latest version?

jonkemp commented 8 years ago

I submitted a pull request on your test repo. It works with gulp-useref 1.3 and 2.0 if you remove the search path.

https://github.com/ssayan/break-gulp-useref/pull/1

sachasayan commented 8 years ago

Hey Jon,

Sorry, I've been out of the country. Will test your new version against my private code ASAP and report back. (The search path is required there.)

jonkemp commented 8 years ago

Closing due to unresponsiveness. If you want to provide some feedback or test against the latest updates, we can reopen this.