INNER CODE UNIT · JavaScript

LocalstackPlugin

localstack/serverless-localstack · src/index.js:38

class LocalstackPlugin {
  constructor(serverless, options) {
    this.serverless = serverless;
    this.options = options;
    this.hooks = { initialize: () => this.init() };
    // Define a before-hook for all event types
    for (const event in this.serverless.pluginManager.hooks) {
      const doAdd = event.startsWith('before:');
      if (doAdd && !this.hooks[event]) {
        this.hooks[event] = this.beforeEventHook.bind(this);
      }
    }
    // Define a hook for aws:info to fix output data
    this.hooks['aws:info:gatherData'] = this.fixOutputEndpoints.bind(this);

    // Define a hook for deploy:deploy to fix handler location for mounted lambda
    this.addHookInFirstPosition(
      'deploy:deploy',

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…