rspress icon indicating copy to clipboard operation
rspress copied to clipboard

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

Open SoonIter opened this issue 10 months ago • 1 comments

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?

https://github.com/shuding/nextra/issues/852

SoonIter avatar Apr 15 '24 07:04 SoonIter

Is there a plan to iteratively support process.env?

canyuegongzi avatar May 28 '24 05:05 canyuegongzi