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

[suggestion] add support for concat option (eg {newLine: ';'} ) #151

Closed hehex9 closed 8 years ago

hehex9 commented 8 years ago

would be useful :smile:

thanks

jonkemp commented 8 years ago

I'm afraid I don't understand the request.

steveluscher commented 8 years ago

I think @pcxiong is talking about a custom separator between files. I just ran into a problem where some off-the-shelf JS without semicolons resulted in a concatenated file that fatals upon evaluation. It would be handy to be able to specify a custom separator, or a function that generates a custom separator.

codeBelt commented 8 years ago

Is there anyway you can add this feature soon?

You can see that gulp-concat has the {newLine: ';'} feature.

I would be happen even if you just added a semicolon to the end of every file's content as a safeguard.

The reason this is an issue is because some libraries are missing that end semicolon and when the files are concatenated together code merges and causes TypeError.

jonkemp commented 8 years ago

https://github.com/jonkemp/gulp-useref/commit/524467db47f10d95b7da987f8374d8307d7a74da

Would still like to add tests for this.

jonkemp commented 8 years ago

Done.