I used PostHTML as suggested by Parcel docs. It allowed me to insert partials using the <include> element, instead of inserting dynamically using js.
<include>