diff options
-rw-r--r-- | .jscsrc | 2 | ||||
-rw-r--r-- | .jshintignore | 2 | ||||
-rw-r--r-- | build/tasks/build.js | 9 | ||||
-rw-r--r-- | src/outro.js | 2 | ||||
-rw-r--r-- | src/wrapper.js (renamed from src/intro.js) | 13 |
5 files changed, 18 insertions, 10 deletions
@@ -5,6 +5,6 @@ // and https://github.com/jscs-dev/node-jscs/issues/1686 "requireCapitalizedComments": null, - "excludeFiles": [ "external", "src/intro.js", "src/outro.js", + "excludeFiles": [ "external", "test/node_smoke_tests/lib/ensure_iterability.js", "node_modules" ] } diff --git a/.jshintignore b/.jshintignore index 1ddafd635..bc2a1e23c 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,6 +1,4 @@ external -src/intro.js -src/outro.js test/data/jquery-1.9.1.js test/data/badcall.js test/data/badjson.js diff --git a/build/tasks/build.js b/build/tasks/build.js index 1f1719a48..2ebb4c47e 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -12,6 +12,11 @@ module.exports = function( grunt ) { requirejs = require( "requirejs" ), srcFolder = __dirname + "/../../src/", rdefineEnd = /\}\s*?\);[^}\w]*$/, + read = function( fileName ) { + return grunt.file.read( srcFolder + fileName ); + }, + globals = read( "exports/global.js" ), + wrapper = read( "wrapper.js" ).split( /\/\/ \@CODE\n\/\/[^\n]+/ ), config = { baseUrl: "src", name: "jquery", @@ -28,8 +33,8 @@ module.exports = function( grunt ) { // Avoid breaking semicolons inserted by r.js skipSemiColonInsertion: true, wrap: { - startFile: "src/intro.js", - endFile: [ "src/exports/global.js", "src/outro.js" ] + start: wrapper[ 0 ].replace( /\/\*jshint .* \*\/\n/, "" ), + end: globals + wrapper[ 1 ] }, rawText: {}, onBuildWrite: convert diff --git a/src/outro.js b/src/outro.js deleted file mode 100644 index d792ffb58..000000000 --- a/src/outro.js +++ /dev/null @@ -1,2 +0,0 @@ -return jQuery; -})); diff --git a/src/intro.js b/src/wrapper.js index 291849526..4ad7776d1 100644 --- a/src/intro.js +++ b/src/wrapper.js @@ -1,3 +1,4 @@ +/*jshint unused:false */ /*! * jQuery JavaScript Library v@VERSION * https://jquery.com/ @@ -11,10 +12,10 @@ * * Date: @DATE */ - -(function( global, factory ) { +( function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` @@ -35,10 +36,16 @@ } // Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { +}( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Support: Firefox 18+ // Can't be in strict mode, several libs including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) //"use strict"; + +// @CODE +// build.js inserts compiled jQuery here + +return jQuery; +} ) ); |