lib/layer.js
function createLayers() {
  if (!this.serverless.service.layers) {
    this.serverless.service.layers = {};
  }
  this.serverless.service.layers['pythonRequirements'] = Object.assign(
    {
      artifact: path.join('.serverless', 'pythonRequirements.zip'),
      name: `${
        this.serverless.service.service
      }-${this.serverless.providers.aws.getStage()}-python-requirements`,
      description:
        'Python requirements generated by serverless-python-requirements.',
      compatibleRuntimes: [this.serverless.service.provider.runtime]
    },
    this.options.layer
  );

  return BbPromise.resolve();
}
function createLayers() {
  if (!this.serverless.service.layers) {
    this.serverless.service.layers = {};
  }
  this.serverless.service.layers['pythonRequirements'] = Object.assign(
    {
      artifact: path.join('.serverless', 'pythonRequirements.zip'),
      name: `${
        this.serverless.service.service
      }-${this.serverless.providers.aws.getStage()}-python-requirements`,
      description:
        'Python requirements generated by serverless-python-requirements.',
      compatibleRuntimes: [this.serverless.service.provider.runtime]
    },
    this.options.layer
  );

  return BbPromise.resolve();
}
function createLayers ( ) { if ( ! this . serverless . service . layers ) { this . serverless . service . layers = { } ; } this . serverless . service . layers [ 'pythonRequirements' ] = Object . assign ( { artifact : path . join ( '.serverless' , 'pythonRequirements.zip' ) , name : ` ${ this . serverless . service . service } ${ this . serverless . providers . aws . getStage ( ) } ` , description : 'Python requirements generated by serverless-python-requirements.' , compatibleRuntimes : [ this . serverless . service . provider . runtime ] } , this . options . layer ) ; return BbPromise . resolve ( ) ; }
Creates a layer on the serverless service for the requirements zip.
@return {Promise} empty promise
Creates a layer on the serverless service for the requirements zip .