Skip to content

Commit 190aaeb

Browse files
coreyfarrellphated
authored andcommitted
New: Honor displayName in ESM exports (closes gulpjs/gulp#2270) (#189)
1 parent 2d8a320 commit 190aaeb

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

lib/shared/register-exports.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function registerExports(gulpInst, tasks) {
1414
return;
1515
}
1616

17-
gulpInst.task(taskName, task);
17+
gulpInst.task(task.displayName || taskName, task);
1818
}
1919
}
2020

test/expected/tasks-as-exports.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
gulp-cli/test/fixtures/gulpfiles
22
├── build
33
├── clean
4-
└─┬ dist
4+
├─┬ dist
5+
│ └─┬ <series>
6+
│ ├── clean
7+
│ └── build
8+
├── f-test
9+
├─┬ p
10+
│ └─┬ <parallel>
11+
│ ├── p1
12+
│ └── p2
13+
├─┬ p-test
14+
│ └─┬ <parallel>
15+
│ ├── p1
16+
│ └── p2
17+
└─┬ s-test
518
└─┬ <series>
619
├── clean
720
└── build

test/fixtures/gulpfiles/gulpfile-exports.babel.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@ export function clean(){};
88
export function build(){};
99
export const string = 'no function';
1010
export const dist = gulp.series(clean, build);
11+
function p1(){}
12+
function p2(){}
13+
export const p = gulp.parallel(p1, p2);
14+
15+
export const sTest = gulp.series(clean, build);
16+
sTest.displayName = 's-test';
17+
18+
export const pTest = gulp.parallel(p1, p2);
19+
pTest.displayName = 'p-test';
20+
21+
export function fTest(){};
22+
fTest.displayName = 'f-test';

0 commit comments

Comments
 (0)