Skip to content

Vite throws JSON parsing error when route block has [lang=json] #166

Closed
@gryphonmyers

Description

<route>
{
  "path": "/"
}
</route>

works fine

<route lang="json">
{
  "path": "/"
}
</route>

Vite throws an error about trying to transform malformed JSON.

It's because it's getting JS syntax here:
https://github.com/hannoeru/vite-plugin-pages/blob/main/src/index.ts#L38

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions