]> source.dussan.org Git - jquery.git/commitdiff
Map Sizzle to a path with config to allow users to put Sizzle wherever they want
authorTimmy Willison <timmywillisn@gmail.com>
Tue, 10 Sep 2013 23:47:36 +0000 (18:47 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Tue, 10 Sep 2013 23:48:53 +0000 (18:48 -0500)
build/tasks/build.js
src/selector-sizzle.js
test/jquery.js

index 21779d80ac70839fed5812abc7cf8840be57ba10..aab7ae0846ddc521ac60a9a1a1f71e7c095cfd8f 100644 (file)
@@ -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;" );
index a2f4787fe38497c5337f5643bd23200a0a76a952..3dbfa3cd072020a198470aa800d725e3908d753c 100644 (file)
@@ -1,6 +1,6 @@
 define([
        "./core",
-       "../bower_components/sizzle/dist/sizzle"
+       "sizzle"
 ], function ( jQuery, Sizzle ) {
 
 jQuery.find = Sizzle;
index fd0be67597a1f39a9de6746fddadd343fdc29256..bdee83c289c16380c6ea32f66606065062aa77d6 100644 (file)
        // 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" ) {