Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b9ed46

Browse files
authored
Build: Create agrunt custom:slim alias for the Slim build (#4578)
Closesgh-4578
1 parentc1ee33a commit9b9ed46

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

‎README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ Exclude a bunch of modules:
146146
grunt custom:-ajax,-css,-deprecated,-dimensions,-effects,-event/alias,-offset,-wrap
147147
```
148148

149+
There is also a special alias to generate a build with the same configuration as the official jQuery Slim build is generated:
150+
```bash
151+
grunt custom:slim
152+
```
153+
149154
For questions or requests regarding custom builds, please start a thread on the[Developing jQuery Core](https://forum.jquery.com/developing-jquery-core) section of the forum. Due to the combinatorics and custom nature of these builds, they are not regularly tested in jQuery's unit test process.
150155

151156
Running the Unit Tests

‎build/release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = function( Release ) {
5050
generateArtifacts:function(callback){
5151
Release.exec("grunt","Grunt command failed");
5252
Release.exec(
53-
"grunt custom:-ajax,-effects --filename=jquery.slim.js && "+
53+
"grunt custom:slim --filename=jquery.slim.js && "+
5454
"grunt remove_map_comment --filename=jquery.slim.js",
5555
"Grunt custom failed"
5656
);

‎build/tasks/build.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,27 @@ module.exports = function( grunt ) {
291291
// Becomes:
292292
//
293293
// grunt build:*:*:+ajax:-dimensions:-effects:-offset
294+
//
295+
// There's also a special "slim" alias that resolves to the jQuery Slim build
296+
// configuration:
297+
//
298+
// grunt custom:slim
294299
grunt.registerTask("custom",function(){
295300
constargs=this.args;
296-
constmodules=args.length ?args[0].replace(/,/g,":") :"";
301+
constmodules=args.length ?
302+
args[0]
303+
.split(",")
304+
305+
// Replace "slim" with respective exclusions meant for
306+
// the official slim build
307+
.reduce((acc,elem)=>acc.concat(
308+
elem==="slim" ?
309+
["-ajax","-effects"] :
310+
[elem]
311+
),[])
312+
313+
.join(":") :
314+
"";
297315
constdone=this.async();
298316
constinsight=newInsight({
299317
trackingCode:"UA-1076265-4",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp