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: 1.11.0-beta1~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5fbf4a4fe32c2d0f9235df5bc5d4a89f61f87330;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 21779d80a..aab7ae084 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..bdee83c28 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" ) {