nitrojs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.build
MIT License
6.16k stars 507 forks source link

feat: include preset config in `.output/nitro.json` #2807

Closed pi0 closed 1 week ago

pi0 commented 1 week ago

This PR adds preset-specific config into .output/nitro.json to be usable for external tools consuming nitro build output.

Original use case: SST needs awsLambda.streaming flag to adjust it's behavior.

Example:

import { defineNitroConfig } from "nitropack/config";

export default defineNitroConfig({
  compatibilityDate: "2024-09-19",
  awsLambda: {
    streaming: true,
  },
});
{
  "date": "2024-10-21T02:49:49.524Z",
  "preset": "aws-lambda",
  "framework": {
    "name": "nitro",
    "version": ""
  },
  "versions": {
    "nitro": "2.9.6"
  },
  "commands": {},
  "config": {
    "awsLambda": {
      "streaming": true
    }
  }
}