Fixed missing file variable issue + added support for ejs templates #1

Merged
merged 12 commits into from Jan 3, 2013

Conversation

Projects
None yet
2 participants
Contributor

jpgarcia commented Dec 24, 2012

@johhnyhalife I've fixed the issue with file as we did with grunt-rev-md5 project

I've also added support for ejs template by adding a new item to the map.

- url: (cdnUrl(resource, filename, relativeTo) || resource)
- });
+ return content.replace(reghtml, function (match, resource) {
+ return match.replace(resource, cdnUrl(resource, filename, relativeTo));
@johnnyhalife

johnnyhalife Dec 26, 2012

Contributor

Por que esto?

tasks/grunt-cdn.js
};
- var reghtml = new RegExp(/(src|href)=['"]([^'"]+)['"]/ig);
+ var reghtml = new RegExp(/<[^a].*[src|href]=['"]([\/][^'"]+)['"].*>/ig);
@johnnyhalife

johnnyhalife Dec 26, 2012

Contributor

Aca estas excluyendo los links?

@@ -80,7 +78,7 @@ module.exports = function (grunt) {
return;
}
- var src = path.join(relativeTo, resourceUrl.pathname);
+ var src = path.join(relativeTo, resourceUrl.pathname).replace(/:\/(\w)/, '://$1');
@johnnyhalife

johnnyhalife Dec 26, 2012

Contributor

Y esto?

johnnyhalife pushed a commit that referenced this pull request Jan 3, 2013

johnny.halife
Merge pull request #1 from jpgarcia/master
Fixed missing file variable issue + added support for ejs templates

@johnnyhalife johnnyhalife merged commit 21171cf into tactivos:master Jan 3, 2013

Contributor

johnnyhalife commented Jan 3, 2013

published as v1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment