Replies: 2 comments 3 replies
-
I'm not convinced by this proposal, I think your problem could be solved by collecting these files via |
Beta Was this translation helpful? Give feedback.
-
I guess Let's take this as an example, you have these routes in your project: pages/
index.astro
about.astro And you have an integration that will automatically add localized routes via
If you add a new route, the integration can call Using edit, maybe not the best example, because you would probably use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
In the Integration API's hook
astro:config:setup
, I want to suggest adding a function to remove an injected route.Background & Motivation
As an integration author it is currently not possible to remove an injected route without restarting the server an then not injecting it.
Why would someone need to remove an injected route?
If an injected route is dependant on files in the user's project you might want to do this.
Goals
Example
I would suggest either of the following APIs. I'm not familiar with the inner workings of Astro, so I'm not sure if they are viable.
Option 1:
Add a function to the options of
astro:config:setup
. I haven't tested if pattern is unique for injected routes, this might be problematic if it isn't.Option 2:
Add a return value to
injectRoute
that removes the route.I think this API would be less useable, and I only provide it as an option if it's more viable.
Beta Was this translation helpful? Give feedback.
All reactions