Skip to content

Build hooks in dev mode #2537

Open
@SimonBerens

Description

@SimonBerens

Describe the bug

Build hooks seem to only run on build. I'm not sure if this is intentional, but it's not documented anywhere and I assumed that they would also run in dev mode.

Specifically, I want to dynamically add stylesheets based on frontmatter parameters, so I am using transformHead, but the link tags are not being added.

Reproduction

This reproduction uses meta tags instead of link tags.

https://stackblitz.com/edit/vite-9gbr2k?file=docs%2F.vitepress%2Fconfig.ts

Expected behavior

robots meta tag appears in dev mode

System Info

stackblitz

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions