.replace( /define\([^{]*?{/, "" )
.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
contents = contents
.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
-define([
- "./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 ) {
+define(function( require ) {
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,
// A central reference to the root jQuery(document)