There were UserFunctions or suggested ViewHelpers to load production assets from ViteJS production builds. This was necessary because they get hashed by default. Since we are using TYPO3, we can reduce the complexity by targeting the core way of including files with following benefits:
Removing the hashing of ViteJS builds, because files are also hashed by TYPO3 to ensure loading of new builds with caching enabled – no need for any custom loading by parsing JSON files
Keeping the original filenames, and since everything is bundled for production we only will have 2 files (main.js & main.css)
Include the files in TypoScript the original core way – TYPO3 core asset handling, JavaScript can be loaded after footer
In case of additional bundles (guessing they will not get more than a hand full) we can load them on demand within FluidTemplates (f:asset) or within TypoScript within target pages plugins, or elements
I have prepared a branch with these changes and will create a Pull Request #22 for that (no matter if this will get merged) to have a look at the changes. The assets are bundled to the public folder without any nesting:
There were UserFunctions or suggested ViewHelpers to load production assets from ViteJS production builds. This was necessary because they get hashed by default. Since we are using TYPO3, we can reduce the complexity by targeting the core way of including files with following benefits:
I have prepared a branch with these changes and will create a Pull Request #22 for that (no matter if this will get merged) to have a look at the changes. The assets are bundled to the public folder without any nesting: