Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Honor displayName in ESM exports. #189

Merged
merged 1 commit into from
Apr 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';