Build: combine intro and outro

Fixes gh-2975
Close gh-2976
This commit is contained in:
Timmy Willison 2016-03-07 11:57:35 -05:00
parent 9b086888b8
commit 4a098f4883
5 changed files with 18 additions and 10 deletions

View File

@ -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" ]
}

View File

@ -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

View File

@ -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

View File

@ -1,2 +0,0 @@
return jQuery;
}));

View File

@ -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;
} ) );