Skip to content

Add onPreDev build plugin hook #3184

@ascorbic

Description

@ascorbic

Is your feature request related to a problem? Please describe.

Build plugins are now able to mutate the config at build time. However these changes are not persisted when running ntl dev.

Describe the solution you'd like

Add a new build plugin hook, e.g. onPreDev, which is called when running ntl dev and before spawning the site's develop command. This could be used to update the configuration, inject env vars etc.

Describe alternatives you've considered

  • Currently we write out a _redirects file if we need redirects to be available during dev, rather than using config mutation. This is fragile, prevents the use of redirects from the TOML file, and means that plugins must require users to run build bedore they can run dev.
  • Persist config changes made during build. However this wouldn't allow us to use different redirects for develop, and could give unexpected results if the user didn't run build beforehand. This also requires build to be run before dev

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions