11ty / eleventy-plugin-bundle

Little bundles of code, little bundles of joy.
72 stars 3 forks source link

Updated instructions to add svg library for Eleventy 3.0 do not work with webc #27

Open urob opened 5 months ago

urob commented 5 months ago

I am trying to adapt the example in the readme (9ef561bb9bdf599e7e243566b97e0dbb73b08226) on how to add an svg library under Eleventy 3.0 using WebC. But I keep getting an error Invalid bundle type: svg.

Are there any updated instructions or an example how to do this using WebC with Eleventy 3.0? (I have seen #12 but this seems to be outdated).


This is the configuration I am trying:

eleventy.config.js:

export default async function (config) {
   config.addBundle('svg')
}

base.webc:

<svg width="0" height="0" aria-hidden="true" style="position: absolute;">
  <defs webc:keep @raw="getBundle('svg')"></defs>
</svg>

This throws an error: Invalid bundle type: svg


Installed versions and subdependencies: