Skip to content

[Feature]: Support _meta.{js,ts} #961

Open
@SoonIter

Description

What problem does this feature solve?

  1. Support comments. In the json file, it is usually very inconvenient for developers to write code comments. We don't know that we use jsonc or json5 to parse it. Supporting _meta.jsonc or _meta.json5 will make it complicated. This is a historical problem.

  2. Support more flexible grammar and better DX

const meta = [...].map((item) => ({
    title: 'I am a title',
    link: item.link
    // ...
}))
export default meta;
  1. Support conditional compilation, such as process.env
const meta = process.env.IS_COMPANY_INNER_DEPLOY ?  [/* 1 */] : [/* 2 */];

export default meta;

What does the proposed API look like?

shuding/nextra#852

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions