I'm serving my JS files and consuming then in PHP files in the following structure:
raiz/tt_agenda/dialogs/dlg_agendamento.php
raiz/tt_agenda/dialogs/dlg_agendamento.js
My applications are static PHP files with HTML in them. No framework behind. To prevent cache I'm currently appending random numbers in the JS script tag as a query like this:
<script src="dlg_agendamento.js?<?=uniqid()?>" />
Recently I started creating and using modular files to import and export some functions. The functions I export are located in:
raiz/lib/js/ttrust/modules
I'm importing them in multiple files in this directory
raiz/
(such as my dlg_agendamento)
With that in mind, I'm currently facing some cache issues with my module files that export functions, they don't have the random string attached to invalidate the cache.
I saw online that Webpack could resolve this issue, but with that specific structure of directories I'm not sure if Webpack is the right approach. How I should handle it?