Now the header resources are extracted using the php template, but the css js resources of each page are different. If all resources are written in the PHP template, it means that each page may load resources that it does not need. How to load different pages on demand? (provided that tools such as webpack are not used)
requireJS
This is a multi-page application. The shared JS and CSS references are written in the template, and each page references them separately