Skip to content

Commit 0f4fdb3

Browse files
committed
lookupTasks becomes optional
1 parent 8b0f601 commit 0f4fdb3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

cds-plugin-openapi/index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ module.exports.activate = () => {
1818
applyTaskDefaults(task) {
1919
task.src = task.src || cds.env.folders.srv.replace(/\/$/, '')
2020
}
21-
async lookupTasks() {
22-
if (process.env.NODE_ENV === 'production') {
23-
return [{ for: this.id }]
24-
}
25-
}
2621
get handler() {
2722
return class extends BuildTaskHandler {
2823
async clean() {
@@ -46,6 +41,16 @@ module.exports.activate = () => {
4641
}
4742
}
4843
}
44+
/**
45+
* Additional constraints can be defined, e.g. generate openapi service specification in production builds only.
46+
* > cds build --production
47+
* > cds build --for node-cf --production
48+
*/
49+
// async lookupTasks() {
50+
// if (process.env.NODE_ENV === 'production') {
51+
// return [{ for: this.id }]
52+
// }
53+
// }
4954
})()
5055
)
5156
}

0 commit comments

Comments
 (0)