]> source.dussan.org Git - jquery.git/commitdiff
Build: Fixed issue with base path that contain 'var'
authorMartin Naumann <martin@geekonaut.de>
Mon, 12 Oct 2015 14:02:25 +0000 (16:02 +0200)
committerOleg Gaidarenko <markelog@gmail.com>
Mon, 12 Oct 2015 15:18:44 +0000 (18:18 +0300)
Remove the cwd from the paths, so the regex doesn't kick in on "var"

Cherry-picked from 0c34e688439713725d4215c63bc4cf876d8d0423
Fixes gh-2450
Closes gh-2641

build/tasks/build.js

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