grunt-usemin
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -12,3 +12,4 @@ 'use strict'; | ||
'tasks/*.js', | ||
'test/**/*.js' | ||
'test/**/*.js', | ||
'!test/temp/scripts/*.js', | ||
] | ||
@@ -22,3 +23,17 @@ } | ||
grunt.registerTask('default', ['jshint']); | ||
grunt.registerTask('test', 'Run tests', function () { | ||
var done = this.async(); | ||
var spawnOpts = { | ||
cmd: 'node_modules/mocha/bin/mocha', | ||
args: grunt.file.expand('test/test-*.js') | ||
}; | ||
grunt.util.spawn(spawnOpts, function (err, res, code) { | ||
grunt.log.write(res.stdout); | ||
if (code) { | ||
throw res.stderr; | ||
} | ||
done(); | ||
}); | ||
}); | ||
grunt.registerTask('default', ['jshint', 'test']); | ||
}; |
@@ -35,3 +35,3 @@ 'use strict'; | ||
this.log('Update the CSS with new img filenames'); | ||
return this.content.replace(/url\(\s*['"]?([^'"\)]+)['"]?\s*\)/gm, function (match, src) { | ||
return this.content.replace(/url\(\s*['"]?([^'"\)#?]+)(?:[#?](?:[^'"\)]*))?['"]?\s*\)/gm, function (match, src) { | ||
// Consider reference from site root | ||
@@ -38,0 +38,0 @@ var file = self.revvedfinder.find(src, self.filepath); |
@@ -38,4 +38,4 @@ 'use strict'; | ||
// start build pattern: will match | ||
// * <!-- build:[target] output --> | ||
// * <!-- build:[target](alternate search path) output --> | ||
// * <!-- build:[target] output --> | ||
// * <!-- build:[target](alternate search path) output --> | ||
// The following matching param are set when there's match | ||
@@ -111,3 +111,10 @@ // * 0 : the whole matched expression | ||
last.requirejs.src = last.src.pop(); | ||
last.requirejs.srcDest = path.join(dest, 'scripts/vendor/require.js'); | ||
var req = l.match(/src=['"]([^'"]+)['"]/); | ||
if (req) { | ||
last.requirejs.origScript = req[1]; | ||
} else { | ||
// For whatever reason ... | ||
last.requirejs.origScript = 'scripts/vendor/require.js'; | ||
} | ||
last.requirejs.srcDest = path.join(dest, last.requirejs.origScript); | ||
last.src.push(last.dest); | ||
@@ -114,0 +121,0 @@ } |
@@ -46,4 +46,4 @@ 'use strict'; | ||
var startAtRoot = false; | ||
var regexpQuote = function(str) { | ||
return (str+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); | ||
var regexpQuote = function (str) { | ||
return (str + '').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1'); | ||
}; | ||
@@ -60,2 +60,3 @@ | ||
startAtRoot = true; | ||
basedir = '.'; | ||
} | ||
@@ -62,0 +63,0 @@ |
{ | ||
"name": "grunt-usemin", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Grunt task replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views).", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"scripts": { | ||
"test": "node node_modules/mocha/bin/mocha test/test-*.js" | ||
"test": "grunt" | ||
}, | ||
@@ -24,0 +24,0 @@ "devDependencies": { |
@@ -112,3 +112,3 @@ # grunt-usemin [![Build Status](https://secure.travis-ci.org/yeoman/grunt-usemin.png?branch=master)](http://travis-ci.org/yeoman/grunt-usemin) | ||
### Basedir | ||
### basedir | ||
Type: 'string' | ||
@@ -115,0 +115,0 @@ Default: nil |
@@ -151,3 +151,11 @@ 'use strict'; | ||
// update concat config for this block | ||
concat[block.dest] = block.src; | ||
if (block.dest.match(/^_/)) { | ||
// grunt does not allow tasks with _, so convert to complex method | ||
concat[block.dest.replace('_', '')] = { | ||
src: block.src, | ||
dest: block.dest | ||
}; | ||
} else { | ||
concat[block.dest] = block.src; | ||
} | ||
grunt.config('concat', concat); | ||
@@ -154,0 +162,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29498
621