diff --git a/lib/plugins/aws/package/index.js b/lib/plugins/aws/package/index.js index 91c6e7235..5548b37b0 100644 --- a/lib/plugins/aws/package/index.js +++ b/lib/plugins/aws/package/index.js @@ -59,6 +59,13 @@ class AwsPackage { this.hooks = { 'initialize': () => { + if (this.serverless.service.provider.disableDefaultOutputExportNames) { + this.serverless._logDeprecation( + 'DISABLE_DEFAULT_OUTPUT_EXPORT_NAMES', + 'Starting with `v3.0.0`, it will not be possible to disable default export names for outputs. To hide this deprecation message and ensure seamless upgrade, please remove this flag.' + ); + } + if (this.serverless.processedInput.commands.join(' ') === 'package') { log.notice(); log.notice( @@ -79,13 +86,6 @@ class AwsPackage { }, 'package:initialize': async () => { - if (this.serverless.service.provider.disableDefaultOutputExportNames) { - this.serverless._logDeprecation( - 'DISABLE_DEFAULT_OUTPUT_EXPORT_NAMES', - 'Starting with `v3.0.0`, it will not be possible to disable default export names for outputs. To hide this deprecation message and ensure seamless upgrade, please remove this flag.' - ); - } - return this.generateCoreTemplate(); },