### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

When running a lambda using E6S export syntax:

```
export const handler = (event) => {
  console.log("hello world");
  console.log(event);

  return event;
};
```

with `"type": "module"` set in my `package.json` I get the following error:

```
ERROR   Uncaught Exception      {"errorType":"Error","errorMessage":"Must use import to load ES Module: /var/task/index.js\nrequire() of ES modules is not supported.\nrequire() of /var/task/index.js from /var/runtime/UserFunction.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.\nInstead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /var/task/package.json.\n","code":"ERR_REQUIRE_ESM","stack":["Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /var/task/index.js","require() of ES modules is not supported.","require() of /var/task/index.js from /var/runtime/UserFunction.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.","Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /var/task/package.json.","","    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)","    at Module.load (internal/modules/cjs/loader.js:928:32)","    at Function.Module._load (internal/modules/cjs/loader.js:769:14)","    at Module.require (internal/modules/cjs/loader.js:952:19)","    at require (internal/modules/cjs/helpers.js:88:18)","    at _tryRequire (/var/runtime/UserFunction.js:75:12)","    at _loadUserApp (/var/runtime/UserFunction.js:95:12)","    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)","    at Object.<anonymous> (/var/runtime/index.js:43:30)","    at Module._compile (internal/modules/cjs/loader.js:1063:30)"]}
```

I have provisioned the lambda with terraform:

```
resource "aws_lambda_function" "test" {
  filename         = "lambda.zip"
  function_name    = "test-function"
  role             = aws_iam_role.lambda.arn
  handler          = "index.handler"
  source_code_hash = data.archive_file.lambda_my_function.output_base64sha256

  runtime = "nodejs14.x"
}
```

### Expected Behavior

I'd expect the lambda to execute successfully without any errors.

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

docker compose up with example docker-compose.yaml file:

```
version: "3.8"

services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack
    network_mode: bridge
    ports:
      - "127.0.0.1:53:53"                # only required for Pro (DNS)
      - "127.0.0.1:53:53/udp"            # only required for Pro (DNS)
      - "127.0.0.1:443:443"              # only required for Pro (LocalStack HTTPS Edge Proxy)
      - "127.0.0.1:4510-4559:4510-4559"  # external service port range
      - "127.0.0.1:4566:4566"            # LocalStack Edge Proxy
    environment:
      - DEBUG=${DEBUG-}
      - DATA_DIR=${DATA_DIR-}
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
      - LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY-}  # only required for Pro
      - HOST_TMP_FOLDER=${TMPDIR:-/tmp/}localstack
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${TMPDIR:-/tmp}/localstack:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
```

Infrastructure is provisioned with the terraform in the example above. The code runs fine when using CommonJS.


Lambda is triggered with the following command:

```
awslocal lambda invoke --function-name test-function --invocation-type Event --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' output.txt
```

### Environment

```markdown
- OS: macOS Mojave 10.14.6 (18G9216)
- LocalStack: latest
```


### Anything else?

_No response_
"""Called once, for any active plugin to run initialization logic (e.g., downloading dependencies).
        Uses lazy initialization - i.e., runs only after the first should_apply() call returns True"""
        pass
    def should_apply(self, context: InvocationContext) -> bool:
        """Whether the plugin logic should get applied for the given Lambda invocation context."""
        return False
    def prepare_invocation(
        self, context: InvocationContext
    ) -> Optional[Union[AdditionalInvocationOptions, InvocationResult]]:
        """Return additional invocation options for given Lambda invocation context. Optionally, an
        InvocationResult can be returned, in which case the result is returned to the client right away."""
        return None
    def process_result(
        self, context: InvocationContext, result: InvocationResult
    ) -> InvocationResult:
        """Optionally modify the result returned from the given Lambda invocation."""
        return result
    def init_function_configuration(self, lambda_function: LambdaFunction):
        """Initialize the configuration of the given function upon creation or function update."""
        pass
    def init_function_code(self, lambda_function: LambdaFunction):
        """Initialize the code of the given function upon creation or function update."""
        pass
    @classmethod
    def get_plugins(cls) -> List["LambdaExecutorPlugin"]: