From 0f4fdb3a89cab4e57e01827e9a8e2ff43110c027 Mon Sep 17 00:00:00 2001 From: Lothar Bender Date: Wed, 24 Nov 2021 09:57:25 +0100 Subject: [PATCH] lookupTasks becomes optional --- cds-plugin-openapi/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cds-plugin-openapi/index.js b/cds-plugin-openapi/index.js index 1ac184ed9..234bdf19e 100644 --- a/cds-plugin-openapi/index.js +++ b/cds-plugin-openapi/index.js @@ -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() { @@ -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 }] + // } + // } })() ) } \ No newline at end of file