]> 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:47:36 +0000 (18:47 -0500)
build/tasks/build.js
src/selector-sizzle.js
test/jquery.js

index cf5fc9b6fc46543a7e6a8842091b75debbbc834e..419c74d4890967eea32dda2be948d6adf6178fbd 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..395258579f66f9901a3b8e2b260f814946b54441 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" ) {