This handles `i18n` cases, ensures `pathname` field is prefixed with `basePath` when configured, and fixes interop with `output: 'export'` configured.