Build: Fixed issue with base path that contain 'var'

Remove the cwd from the paths, so the regex doesn't kick in on "var"

Fixes gh-2450
Closes gh-2641
This commit is contained in:
Martin Naumann 2015-10-12 16:02:25 +02:00 committed by Oleg Gaidarenko
parent 03eaadb131
commit 0c34e68843

View File

@ -53,7 +53,7 @@ module.exports = function( grunt ) {
var amdName; var amdName;
// Convert var modules // Convert var modules
if ( /.\/var\//.test( path ) ) { if ( /.\/var\//.test( path.replace( process.cwd(), "" ) ) ) {
contents = contents contents = contents
.replace( /define\([\w\W]*?return/, "var " + ( /var\/([\w-]+)/.exec( name )[ 1 ] ) + " =" ) .replace( /define\([\w\W]*?return/, "var " + ( /var\/([\w-]+)/.exec( name )[ 1 ] ) + " =" )
.replace( rdefineEnd, "" ); .replace( rdefineEnd, "" );