11ty / webc

Single File Web Components
MIT License
1.33k stars 39 forks source link

getBundle not working #159

Closed cfjedimaster closed 1 year ago

cfjedimaster commented 1 year ago

I'm filing this here and not in the getBundle repo as I assume it's an issue with WebC's use of the other project. I've got a component with a script tag in it. It gets bundled up fine. In Liquid, I'm trying to use it like so:

<script>
{{ getBundle "js"}}
</script>

This returns an empty string (between the script tags). Yet this deprecated code still works:

<script>{{ page.url | webcGetJs }}</script>
zachleat commented 1 year ago

{% getBundle "js" %} is the syntax!

https://github.com/11ty/eleventy-plugin-bundle#render-bundle-code

cfjedimaster commented 1 year ago

I could have sworn I tried this - sorry!

zachleat commented 1 year ago

It’s really no worries at all! Easy mistake, easy fix!