Closed OlenDavis closed 10 years ago
Someone else brought this up too, and just recommended I use url. Thoughts?
How about prefix + url.parse( url )
? That way, you enforce the implication that the url is a url, while treating the prefix very simply as a prefix? And any developer that was depending on the nearly undetermined previous behavior will simply be coerced into clarifying their own internal logic.
Sorry; that'd be prefix + url.format( url.parse( urlString ) )
where urlString
is the result of the url
option string/function.
How's it look Eric?
@OlenDavis Trying to resolve the tests now.
Can you do me a favor & post how you're using this exactly? I'm assuming you have a prefix of http://cdn.mysite.com/assets
which is then joined with app/templates/home.html
or similar, right?
Like so:
ngtemplates:
ngApp:
cwd : '<%= pkg.buildDir %>/<%= pkg.builtDir %>/template'
src : '**/*.html'
dest : builtTemplatesJs
options:
module : pkg.ngApp
url : ( url ) -> "#{ staticFilePath }template/#{ url }#{ preprocessContext.APPLICATION_CONFIG_staticFileSuffix }"
htmlmin:
collapseBooleanAttributes: no
collapseWhitespace : yes
removeAttributeQuotes : yes
removeComments : yes
removeEmptyAttributes : yes
removeRedundantAttributes: yes
Let me know how v0.4.9
works out for ya!
Will do! And thank you kindly!
..., and as url's are not merely paths when they specify a scheme (https://, http://, etc), this normalization breaks some builds. Allows developers to specify strings that incorporate two forward slashes intentionally as part of the scheme of their template urls (for instance, for hosting those files from a CDN when not pre-cached - and note that the Path module's normalization doesn't take this case into account) by checking whether the involved parts of the url include "://" and if so, simply concatenating them, and using Path's join (which normalizes the resulting url) otherwise.