diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2013-09-10 18:47:36 -0500 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2013-09-10 18:48:53 -0500 |
commit | 5fbf4a4fe32c2d0f9235df5bc5d4a89f61f87330 (patch) | |
tree | 141d9a6f5d1d97ba02738e6cac0207aa1ed03c1c | |
parent | 812319093a87594b88a6fdb99d9879e14196b9e1 (diff) | |
download | jquery-5fbf4a4fe32c2d0f9235df5bc5d4a89f61f87330.tar.gz jquery-5fbf4a4fe32c2d0f9235df5bc5d4a89f61f87330.zip |
Map Sizzle to a path with config to allow users to put Sizzle wherever they want
-rw-r--r-- | build/tasks/build.js | 5 | ||||
-rw-r--r-- | src/selector-sizzle.js | 2 | ||||
-rw-r--r-- | test/jquery.js | 7 |
3 files changed, 11 insertions, 3 deletions
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" ) { |