mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Add AMD+CommonJS capabilities to the build script (for modules with long unreadable dependency lists)
Conflicts: src/core.js
This commit is contained in:
parent
a289beb688
commit
ee0343dd1b
@ -62,6 +62,14 @@ module.exports = function( grunt ) {
|
|||||||
.replace( /define\([^{]*?{/, "" )
|
.replace( /define\([^{]*?{/, "" )
|
||||||
.replace( rdefineEnd, "" );
|
.replace( rdefineEnd, "" );
|
||||||
|
|
||||||
|
// Remove CommonJS-style require calls
|
||||||
|
// Keep an ending semicolon
|
||||||
|
contents = contents
|
||||||
|
.replace( /\w+ = require\(\s*(")[\w\.\/]+\1\s*\)([,;])/g,
|
||||||
|
function( all, quote, commaSemicolon ) {
|
||||||
|
return commaSemicolon === ";" ? ";" : "";
|
||||||
|
});
|
||||||
|
|
||||||
// Remove empty definitions
|
// Remove empty definitions
|
||||||
contents = contents
|
contents = contents
|
||||||
.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
|
.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
|
||||||
|
29
src/core.js
29
src/core.js
@ -1,21 +1,18 @@
|
|||||||
define([
|
define(function( require ) {
|
||||||
"./var/strundefined",
|
|
||||||
"./var/deletedIds",
|
|
||||||
"./var/slice",
|
|
||||||
"./var/concat",
|
|
||||||
"./var/push",
|
|
||||||
"./var/indexOf",
|
|
||||||
// [[Class]] -> type pairs
|
|
||||||
"./var/class2type",
|
|
||||||
"./var/toString",
|
|
||||||
"./var/hasOwn",
|
|
||||||
"./var/trim",
|
|
||||||
"./var/rsingleTag",
|
|
||||||
"./var/support"
|
|
||||||
], function( strundefined, deletedIds, slice, concat, push, indexOf,
|
|
||||||
class2type, toString, hasOwn, trim, rsingleTag, support ) {
|
|
||||||
|
|
||||||
var
|
var
|
||||||
|
deletedIds = require( "./var/deletedIds" ),
|
||||||
|
slice = require( "./var/slice" ),
|
||||||
|
concat = require( "./var/concat" ),
|
||||||
|
push = require( "./var/push" ),
|
||||||
|
indexOf = require( "./var/indexOf" ),
|
||||||
|
class2type = require( "./var/class2type" ),
|
||||||
|
toString = require( "./var/toString" ),
|
||||||
|
hasOwn = require( "./var/hasOwn" ),
|
||||||
|
trim = require( "./var/trim" ),
|
||||||
|
rsingleTag = require( "./var/rsingleTag" ),
|
||||||
|
support = require( "./var/support" ),
|
||||||
|
|
||||||
i,
|
i,
|
||||||
|
|
||||||
// A central reference to the root jQuery(document)
|
// A central reference to the root jQuery(document)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
define(function() {
|
define(function() {
|
||||||
|
// [[Class]] -> type pairs
|
||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user