https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35716
--- Comment #38 from Paul Derscheid <[email protected]> --- Created attachment 185104 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185104&action=edit Bug 35716: (another alternate) Use rspack to manage shared JS assets between OPAC and Staff This POC introduces a shared assets directory and configures rspack to build (currently) identical JS files from a single source to both OPAC and Staff locations, eliminating code duplication and preventing drift. The POC uses cookieconsent.js which already started to drift into diverging implementations (OPAC: 257 lines, Staff: 199 lines). Here, this is due to different requirements in Staff Interface vs OPAC. One way to handle this is to have aliases configured in rspack that import what's needed for the respective bundle via module imports. If needed I can provide an extended POC for that feature specifically but wanted to show first how this could work. How it works: - Source files live in koha-tmpl/shared/js/ (this is totally arbitrary) - Rspack builds twice: once to intranet-tmpl/prog/js/, once to opac-tmpl/bootstrap/js/ - Templates continue using [% Asset.js() %] unchanged Test plan: 1. Apply patch 2. Run: yarn js:build 3. Verify koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js exists 4. Verify koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js exists 5. Confirm both files are identical 6. Test cookie consent functionality works in both OPAC and Staff interface (with the caveats brought up earlier) -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
