diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2020-01-07 16:42:49 +0100 |
---|---|---|
committer | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2020-01-07 16:45:22 +0100 |
commit | 4cbdc745cc32f0fb8865139df7caad075b05d2b8 (patch) | |
tree | e1f65e830d968c4f8a92f60e67cb2f05b7a98ce2 /build | |
parent | f36f6abbb3e9e4d7d3729272ffb10b4c2c382919 (diff) | |
download | jquery-4cbdc745cc32f0fb8865139df7caad075b05d2b8.tar.gz jquery-4cbdc745cc32f0fb8865139df7caad075b05d2b8.zip |
Build: Create a `grunt custom:slim` alias for the Slim build
Closes gh-4578
(cherry-picked from 9b9ed469b43e9fa6e2c752444470ae4c87d03d57)
Diffstat (limited to 'build')
-rw-r--r-- | build/release.js | 2 | ||||
-rw-r--r-- | build/tasks/build.js | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/build/release.js b/build/release.js index a9713fc08..9b529b653 100644 --- a/build/release.js +++ b/build/release.js @@ -54,7 +54,7 @@ module.exports = function( Release ) { generateArtifacts: function( callback ) { Release.exec( "grunt", "Grunt command failed" ); Release.exec( - "grunt custom:-ajax,-effects --filename=jquery.slim.js && " + + "grunt custom:slim --filename=jquery.slim.js && " + "grunt remove_map_comment --filename=jquery.slim.js", "Grunt custom failed" ); diff --git a/build/tasks/build.js b/build/tasks/build.js index 1a6e5d02a..bdde74cee 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -333,9 +333,27 @@ module.exports = function( grunt ) { // Becomes: // // grunt build:*:*:+ajax:-dimensions:-effects:-offset + // + // There's also a special "slim" alias that resolves to the jQuery Slim build + // configuration: + // + // grunt custom:slim grunt.registerTask( "custom", function() { var args = this.args, - modules = args.length ? args[ 0 ].replace( /,/g, ":" ) : "", + modules = args.length ? + args[ 0 ] + .split( "," ) + + // Replace "slim" with respective exclusions meant for + // the official slim build + .reduce( ( acc, elem ) => acc.concat( + elem === "slim" ? + [ "-ajax", "-effects" ] : + [ elem ] + ), [] ) + + .join( ":" ) : + "", done = this.async(), insight = new Insight( { trackingCode: "UA-1076265-4", |