Skip to content

Commit

Permalink
Merge branch 'release/0.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Holland committed Aug 4, 2014
2 parents 0877ba3 + d786f77 commit 1a970e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-cache-bust",
"description": "Bust static assets from the cache using content hashing",
"version": "0.4.2",
"version": "0.4.3",
"author": "Ben Holland <[email protected]>",
"repository": {
"type": "git",
Expand Down
18 changes: 11 additions & 7 deletions tasks/cachebust.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,21 @@ module.exports = function(grunt) {
var cssObj = css.parse(data);

// Loop through each stylesheet rules
cssObj.stylesheet.rules.forEach(function(rule) {
if(cssObj.stylesheet) {
cssObj.stylesheet.rules.forEach(function(rule) {

// Loop through all declarations
rule.declarations.forEach(function(declaration) {
// Loop through all declarations
if(rule.declarations) {
rule.declarations.forEach(function(declaration) {

// Check if it has a background property, and if so, checkt that it contains a URL
if((/background/).test(declaration.property) && (/url/).test(declaration.value)) {
paths.push(declaration.value.match(/url\(["|']?(.*?)['|"]?\)/)[1]);
// Check if it has a background property, and if so, checkt that it contains a URL
if((/background/).test(declaration.property) && (/url/).test(declaration.value)) {
paths.push(declaration.value.match(/url\(["|']?(.*?)['|"]?\)/)[1]);
}
});
}
});
});
}
} else {
// Add any conditional statements or assets in comments to the DOM
var assets = '';
Expand Down

0 comments on commit 1a970e2

Please sign in to comment.