analog icon indicating copy to clipboard operation
analog copied to clipboard

'Post build' Hook

Open alexcibotari opened this issue 1 year ago • 2 comments

Which scope/s are relevant/related to the feature request?

vite-plugin-angular

Information

As a developer, I need a hook at the end of the build when all pages are rendered, and I can access them to create the index for search. At the moment Analog exposes postRenderingHooks after each page render. this is not enough to create a site search index, like a sitemap, where content for each page will be also available. or at least a hook with all generated paths, and I can traverse by my self.

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

  • [ ] Yes
  • [ ] No

alexcibotari avatar May 23 '24 17:05 alexcibotari

There's a hook in nitro for this

analog({
  nitro: {
    hooks: {
      "prerender:done": ({ prerenderedRoutes }) => {
        console.log(prerenderedRoutes);
      }
    }
  }
})

brandonroberts avatar May 23 '24 21:05 brandonroberts

The issue is, that they will not run during: npm run dev, event after build npm run dev will delete the file

alexcibotari avatar May 25 '24 15:05 alexcibotari