]> 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:17:12 +0000 (18:17 +0300)
Remove the cwd from the paths, so the regex doesn't kick in on "var"

Fixes gh-2450
Closes gh-2641

build/tasks/build.js

index 750bac5b75257cd83578f269dae1f1a6138c1d3e..74fa47fde45cd34525445fa6fa85e63e9ffdb311 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, "" );