Skip to content

Commit

Permalink
New: Honor displayName in ESM exports (closes gulpjs/gulp#2270) (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell authored and phated committed Apr 20, 2019
1 parent 2d8a320 commit 190aaeb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/shared/register-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function registerExports(gulpInst, tasks) {
return;
}

gulpInst.task(taskName, task);
gulpInst.task(task.displayName || taskName, task);
}
}

Expand Down
15 changes: 14 additions & 1 deletion test/expected/tasks-as-exports.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
gulp-cli/test/fixtures/gulpfiles
├── build
├── clean
└─┬ dist
├─┬ dist
│ └─┬ <series>
│ ├── clean
│ └── build
├── f-test
├─┬ p
│ └─┬ <parallel>
│ ├── p1
│ └── p2
├─┬ p-test
│ └─┬ <parallel>
│ ├── p1
│ └── p2
└─┬ s-test
└─┬ <series>
├── clean
└── build
12 changes: 12 additions & 0 deletions test/fixtures/gulpfiles/gulpfile-exports.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,15 @@ export function clean(){};
export function build(){};
export const string = 'no function';
export const dist = gulp.series(clean, build);
function p1(){}
function p2(){}
export const p = gulp.parallel(p1, p2);

export const sTest = gulp.series(clean, build);
sTest.displayName = 's-test';

export const pTest = gulp.parallel(p1, p2);
pTest.displayName = 'p-test';

export function fTest(){};
fTest.displayName = 'f-test';

0 comments on commit 190aaeb

Please sign in to comment.