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

2.0 is not compatible with 1.3 ? #142

Closed dynchen closed 8 years ago

dynchen commented 8 years ago

When I update to the 2.0 , the old code doesn't work. The error msg is : File not found with singular glob. why ? Thx.

jonkemp commented 8 years ago

No it's not, hence the new version number. It throws the error now if you have a bad file path, so you have a bad file path somewhere. This was a change made in the vinyl-fs module.

dynchen commented 8 years ago

Well ,in my project, the glob.sync function might not return a correct file path array.

dynchen commented 8 years ago

something like {.tmp/serve,src}, the latter src will be ignored. And in some case ,'{' may be added to the file path incorrectly.

jonkemp commented 8 years ago

I'm not sure what you are asking. If you have a specific question or problem, please post a code example.

charlessolar commented 8 years ago

I got this error message, the problem was one of the paths in my css bundle was incorrect. In the previous version I suppose this was just ignored - now its not.

I don't mind the change but maybe a more helpful error message would be nice :)

dynchen commented 8 years ago

Yeah, I found it's indeed the bad file path that cause my problem.Sorry for my mistake ,thx.

fyrebase commented 8 years ago

Add this at line 113 to easily see which asset is causing the problem.

    var fs = require('fs');
    fs.stat(pattern, function(err, stat) {
            if(err) {
                console.log('[INVALID PATH] ' + err.path);
            }
    });
jonkemp commented 8 years ago

Can this be closed?

fyrebase commented 8 years ago

I would. The question has been answered

dynchen commented 8 years ago

Of course