diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2020-01-07 16:42:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-07 16:42:49 +0100 |
commit | 9b9ed469b43e9fa6e2c752444470ae4c87d03d57 (patch) | |
tree | a37dc4f1aa8f8cb05ac5103cf0ab9afd3a423bec /build/tasks/build.js | |
parent | c1ee33aded44051b8f1288b59d2efdc68d0413cc (diff) | |
download | jquery-9b9ed469b43e9fa6e2c752444470ae4c87d03d57.tar.gz jquery-9b9ed469b43e9fa6e2c752444470ae4c87d03d57.zip |
Build: Create a `grunt custom:slim` alias for the Slim build (#4578)
Closes gh-4578
Diffstat (limited to 'build/tasks/build.js')
-rw-r--r-- | build/tasks/build.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js index 4abc70868..18d101f0b 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -291,9 +291,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() { const args = this.args; - const modules = args.length ? args[ 0 ].replace( /,/g, ":" ) : ""; + const 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( ":" ) : + ""; const done = this.async(); const insight = new Insight( { trackingCode: "UA-1076265-4", |