From: Timmy Willison Date: Tue, 10 Sep 2013 23:47:36 +0000 (-0500) Subject: Map Sizzle to a path with config to allow users to put Sizzle wherever they want X-Git-Tag: 2.1.0-beta1~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aab9d632797c46728a22eb615bd18cb7f5c9c497;p=jquery.git Map Sizzle to a path with config to allow users to put Sizzle wherever they want --- diff --git a/build/tasks/build.js b/build/tasks/build.js index cf5fc9b6f..419c74d48 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -26,6 +26,9 @@ module.exports = function( grunt ) { startFile: "src/intro.js", endFile: "src/outro.js" }, + paths: { + sizzle: "../bower_components/sizzle/dist/sizzle" + }, rawText: {}, onBuildWrite: convert }; @@ -47,7 +50,7 @@ module.exports = function( grunt ) { .replace( rdefineEnd, "" ); // Sizzle treatment - } else if ( /\/sizzle$/.test( name ) ) { + } else if ( /^sizzle$/.test( name ) ) { contents = "var Sizzle =\n" + contents // Remove EXPOSE lines from Sizzle .replace( /\/\/\s*EXPOSE[\w\W]*\/\/\s*EXPOSE/, "return Sizzle;" ); diff --git a/src/selector-sizzle.js b/src/selector-sizzle.js index a2f4787fe..3dbfa3cd0 100644 --- a/src/selector-sizzle.js +++ b/src/selector-sizzle.js @@ -1,6 +1,6 @@ define([ "./core", - "../bower_components/sizzle/dist/sizzle" + "sizzle" ], function ( jQuery, Sizzle ) { jQuery.find = Sizzle; diff --git a/test/jquery.js b/test/jquery.js index fd0be6759..395258579 100644 --- a/test/jquery.js +++ b/test/jquery.js @@ -28,7 +28,12 @@ // If QUnit is on window, this is the main window // This detection allows AMD tests to be run in an iframe if ( QUnit.urlParams.amd && window.QUnit ) { - require.config({ baseUrl: path }); + require.config({ + baseUrl: path, + paths: { + sizzle: path + 'bower_components/sizzle/dist/sizzle' + } + }); src = "src/jquery"; // Include tests if specified if ( typeof loadTests !== "undefined" ) {