A Vanilla Web Component for including external media, like an iFrame but better
npm i @vanillawc/wc-include
Then import the
index.js file at the root of the package.
- shadow - if present the contents are contained in a shadowDOM
src attribute imports the contents of the file into the lightDOM.
'shadow' Attribute Usage
shadow attribute is specified, the imported contents will be encapsulated in a shadowDOM.
<wc-include src="./sample.html" shadow></wc-include>