html-bundler-webpack-plugin icon indicating copy to clipboard operation
html-bundler-webpack-plugin copied to clipboard

[FEATURE REQUEST]: Add option to dynamically generate a sitemap.xml

Open Paillat-dev opened this issue 10 months ago • 3 comments

Feature request

What is motivation or use case for adding/changing the behaviour? Having an option to have the plugin generate dynamically a sitemap.xml file containing all files / all files matching some criteria.

Describe the solution you'd like I don't really have any syntax idea.

Describe alternatives you've considered Just doing it manually, it's okay as long as there aren't too many pages.

Paillat-dev avatar Apr 23 '24 20:04 Paillat-dev

Hallo @Paillat-dev,

thanks for the feature request.

The plugin is ready to write own plugin or callback to generate a tree of the used resources.

  1. you can use the verbose: true options to display all processed resources in terminal output
  2. you can use the afterEmit callback or hook where you have full list of all resources used in all entrypoints.
  3. you can see how you can write own plugin for the plugin using the afterEmit hook or afterEmit callback. In this example is a simple implementation of a manifest. Easily you can adapt it to generate a sitemap.xml.

Тo be honest, the last time I generated a sitemap.xml was more than 15 years ago ;-) Who use it today?

webdiscus avatar Apr 23 '24 20:04 webdiscus

I mean I would answer myself, but more seriously, it is still somewhat relevant for search engines, and cand speed up indexation quite a bit when it's used, at least from what I noticed. I'll see what I can do with that and maybe reply here, or even open a pr. Thanks for the info!

Paillat-dev avatar Apr 23 '24 20:04 Paillat-dev

The only thing that is not contained in the list are static resources that have not been processed and links to pages. But it can by crawled and tricky cached using the sources option.

webdiscus avatar Apr 23 '24 21:04 webdiscus

@Paillat-dev can be closed the issue or you have questions for topic?

webdiscus avatar Jul 24 '24 21:07 webdiscus

@webdiscus I didn't do it in the end. You can close if you want.

Paillat-dev avatar Jul 24 '24 22:07 Paillat-dev