INNER CODE UNIT · JavaScript

compileFunction

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

    function compileFunction(functionName) {
      const functionObject = this.serverless.service.getFunction(functionName);
      if (functionObject.image || !this.shouldMountCode()) {
        return compileFunction._functionOriginal.apply(null, arguments);
      }
      functionObject.package = functionObject.package || {};
      functionObject.package.artifact = __filename;
      return compileFunction._functionOriginal
        .apply(null, arguments)
        .then(() => {
          const resources =
            this.serverless.service.provider.compiledCloudFormationTemplate
              .Resources;
          Object.keys(resources).forEach((id) => {
            const res = resources[id];
            if (res.Type === 'AWS::Lambda::Function') {
              res.Properties.Code.S3Bucket =
                process.env.BUCKET_MARKER_LOCAL || 'hot-reload'; // default changed to 'hot-reload' with LS v2 release

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…