gulp-useref
gulp-useref copied to clipboard
Doesn't accept spaces in the path?
In my CSS path I have 'spaces'. Useref doesn't respect it.
Input:
<!-- build:css ../Style Library/AP/CSS/AP.min.css -->
<link href="../Style Library/AP/CSS/Tile.css" rel="stylesheet" />
<link href="../Style Library/AP/CSS/Dropdown.css" rel="stylesheet" />
<!-- endbuild -->
Output:
<link rel="stylesheet" href="../Style" Library/ActionPack/CSS/ActionPack.min.css>
It breaks the reference.
Any solution?
Also, if I specify %20 instead of 'space', the library creates a folder like 'Style%20Library'.
Thanks for pointing that out. No, if neither of those works, then there are no solutions at this time.
Can this be considered as a feature request?
Sure.
Ok, taking a look at this, I am not planning on adding this feature at this time. The reason is the current pattern of the build block comment doesn't allow for it. Check out the useref README to see what I mean.
https://github.com/jonkemp/useref/blob/master/README.md
The top comment where it gets the build path from looks like this.
<!-- build:<type>(alternate search path) <path> <parameters> -->
The problem is that the regex looks for a space to tell where the path ends and the parameters begin. So a space in the path is a problem because the regex sees it as a stop and that is why it is not working currently.
As I do not see an easy way around this, it will not be supported until that changes somehow. Sorry for any inconvenience. Thanks.
Use ;
to separate
<!-- build:js; js/index.js; async -->
Or better, put the path in a string: "path"
<!-- build:js "js/index.js" async -->
@manuel-di-iorio since this is the only complaint I've seen about spaces in paths, it seems to be an edge case to me. I don't want to break backwards compatibility for all users for an edge case. It's easier just to not have spaces in the path, or if that is a requirement, add tasks to copy files there then update the paths.
+1 on this feature, in my case I'm trying to include some PHP into it like:
<!-- build:css <?php print $baseDir; ?>Resources/style.min.css -->
But it doesn't work, as expected.