Skip to content

Add ability to detect if theme is in "dev" mode #10

Open
@BryceRussell

Description

@BryceRussell

Currently astro-theme-provider runs all code for both the author and user, but in some cases code only needs to be executed while authoring/developing a theme.

astro-theme-provider could solve this by checking for the existence of a package.json inside a playground directory. A theme package already has to be developed inside of a monorepo with a playground for type generation so checking for the existence of the playground's package.json should be a safe way of validating that a theme is running in "dev" mode since this file wont be included in the final output of the package.

export default defineTheme({
  dev: '../playground' // default value
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededtodoGoal for next major release

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions