Vanilla html js css with some super power from parcel

I am working on a simple side project. The stuffs are very simple, I just need some simple html css and vanilla javascript. Everything is static so that I can simply use Cloudflare Page.

That said, I would like to have some super power from modern frontend tools that can compact the html, js, css and also perform tree shaking. Then I bring in parcel, daisyUI and tailwind.

There is one thing really missing. In the old php days, we can template the page by including other php files like including header.php and including footer.php.

The target is to reuse the template of the page, including the and sections. Web component could be an alternative but it cannot let me reuse all the stuffs in the and section.

Does anyone know any tools can achieve that? Thank you!