Function mergeSeiaConfig

  • Smartly merge two SeiaConfigs.

    This function will merge two configs recursively, leaving the unspecified fields as is.

    This function is useful when you want to change only a few fields from the base config.

    The result will be a new object, and the original objects will not be mutated.

    This function does not perform validation. If you want to validate and produce a fully resolved config, use resolveSeiaConfig instead.

    Parameters

    • defaults: {
          paths?: {
              anchor?: string;
              dist?: string;
              entry?: string;
              rsc?: string;
              src?: string;
              ssr?: string;
          };
          serve?: {
              port?: number;
          };
      }
      • Optional paths?: {
            anchor?: string;
            dist?: string;
            entry?: string;
            rsc?: string;
            src?: string;
            ssr?: string;
        }
        • Optional anchor?: string
        • Optional dist?: string
        • Optional entry?: string
        • Optional rsc?: string
        • Optional src?: string
        • Optional ssr?: string
      • Optional serve?: {
            port?: number;
        }
        • Optional port?: number
    • overrides: {
          paths?: {
              anchor?: string;
              dist?: string;
              entry?: string;
              rsc?: string;
              src?: string;
              ssr?: string;
          };
          serve?: {
              port?: number;
          };
      }
      • Optional paths?: {
            anchor?: string;
            dist?: string;
            entry?: string;
            rsc?: string;
            src?: string;
            ssr?: string;
        }
        • Optional anchor?: string
        • Optional dist?: string
        • Optional entry?: string
        • Optional rsc?: string
        • Optional src?: string
        • Optional ssr?: string
      • Optional serve?: {
            port?: number;
        }
        • Optional port?: number

    Returns {
        paths?: {
            anchor?: string;
            dist?: string;
            entry?: string;
            rsc?: string;
            src?: string;
            ssr?: string;
        };
        serve?: {
            port?: number;
        };
    }

    The merged config object.

    • Optional paths?: {
          anchor?: string;
          dist?: string;
          entry?: string;
          rsc?: string;
          src?: string;
          ssr?: string;
      }
      • Optional anchor?: string
      • Optional dist?: string
      • Optional entry?: string
      • Optional rsc?: string
      • Optional src?: string
      • Optional ssr?: string
    • Optional serve?: {
          port?: number;
      }
      • Optional port?: number

    Example

    mergeSeiaConfig({
    paths: {
    src: '.',
    }
    }, {
    paths: {
    entry: 'Page.tsx',
    }
    })
    // will be evaluated to:
    // {
    // paths: {
    // src: '.',
    // entry: 'Page.tsx',
    // }
    // }