I want to generate automatically a sitemap.xml file. For this, in my npm command, I want to call "node config/sitemap.js" before calling webpack for generating my front-end bundle.
However, if I do import mongoose or require mongoose whatsoever, node will complain it does not find the module. Does that mean I need to have another webpack configuration just for the sitemap generator? What should be the minimum in order to be able to query a DB and generate a file?
Is this the way to go? Or do you have any other way to achieve what I want?
Thank you in advance and regards