Skip to content

Commit

Permalink
lookupTasks becomes optional
Browse files Browse the repository at this point in the history
  • Loading branch information
LotharBender committed Nov 24, 2021
1 parent 8b0f601 commit 0f4fdb3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cds-plugin-openapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ module.exports.activate = () => {
applyTaskDefaults(task) {
task.src = task.src || cds.env.folders.srv.replace(/\/$/, '')
}
async lookupTasks() {
if (process.env.NODE_ENV === 'production') {
return [{ for: this.id }]
}
}
get handler() {
return class extends BuildTaskHandler {
async clean() {
Expand All @@ -46,6 +41,16 @@ module.exports.activate = () => {
}
}
}
/**
* Additional constraints can be defined, e.g. generate openapi service specification in production builds only.
* > cds build --production
* > cds build --for node-cf --production
*/
// async lookupTasks() {
// if (process.env.NODE_ENV === 'production') {
// return [{ for: this.id }]
// }
// }
})()
)
}

0 comments on commit 0f4fdb3

Please sign in to comment.