Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Remove complexity of loading production assets and use TYPO3 core loading #23

Closed
peter-neumann-dev opened this issue Jan 30, 2023 · 1 comment

Comments

@peter-neumann-dev
Copy link
Contributor

peter-neumann-dev commented Jan 30, 2023

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:

├── Resources
│   └── Public
│       ├── main.css
│       └── main.js
@peter-neumann-dev
Copy link
Contributor Author

See comments #22

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant