mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
feat(Packaging): Deprecate package.include and package.exclude
This commit is contained in:
parent
b5069ef8cb
commit
62017754f7
@ -38,6 +38,16 @@ Note:
|
||||
- The `serverless.yml` setting is ineffective for deprecations reported before the configuration is read.
|
||||
- `SLS_DEPRECATION_DISABLE` and `disabledDeprecations` remain respected, and no errors will be thrown for mentioned deprecation codes.
|
||||
|
||||
<a name="PACKAGE_PATTERNS"><div> </div></a>
|
||||
|
||||
## New way to define packaging patterns
|
||||
|
||||
Deprecation code: `PACKAGE_PATTERNS`
|
||||
|
||||
Support for `package.include` and `package.exclude` will be removed with v4.0.0. Instead please use `package.patterns` with which both _include_ and _exclude_ (prefixed with `!`) rules can be configured.
|
||||
|
||||
Check [Packaging Patterns](/framework/docs/providers/aws/guide/packaging/#patterns) documentation for more info.
|
||||
|
||||
<a name="CLI_DEPLOY_FUNCTION_OPTION_V3"><div> </div></a>
|
||||
|
||||
## CLI `--function`/`-f` option for `deploy` command
|
||||
|
||||
@ -33,6 +33,26 @@ class Package {
|
||||
};
|
||||
|
||||
this.hooks = {
|
||||
'initialize': () => {
|
||||
const usesIncludeOrExclude = (packageConfig = {}) =>
|
||||
packageConfig.include || packageConfig.exclude;
|
||||
|
||||
if (
|
||||
usesIncludeOrExclude(this.serverless.service.package || {}) ||
|
||||
Object.values(this.serverless.service.functions).some((func) =>
|
||||
usesIncludeOrExclude(func.package)
|
||||
) ||
|
||||
Object.values(this.serverless.service.layers || {}).some((func) =>
|
||||
usesIncludeOrExclude(func.package)
|
||||
)
|
||||
) {
|
||||
this.serverless._logDeprecation(
|
||||
'PACKAGE_PATTERNS',
|
||||
'Support for "package.include" and "package.exclude" will be removed in the next' +
|
||||
' major release. Please use "package.patterns" instead'
|
||||
);
|
||||
}
|
||||
},
|
||||
'package:createDeploymentArtifacts': async () =>
|
||||
BbPromise.bind(this).then(this.packageService),
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user