Skip to content

Commit

Permalink
WebC Consistency note
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Feb 2, 2023
1 parent 4fd46c3 commit 5ba451c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ To add JS to a page bundle in WebC, you would use a `<script>` element in a WebC
<script webc:keep>/* Do not bundle me—leave as is */</script>
```

* Existing calls via WebC helpers `getCss` or `getJs` (e.g. `<style @raw="getCss(page.url)">`) have been wired up to this plugin behind the scenes.
* Existing calls via WebC helpers `getCss` or `getJs` (e.g. `<style @raw="getCss(page.url)">`) have been wired up to `getBundle('css')` and `getBundle('js')` automatically.
* For consistency, you may prefer using the bundle plugin method names everywhere: `<style @raw="getBundle('css')">` and `<script @raw="getBundle('js')">` both work fine.
* Outside of WebC, the [Universal Filters `webcGetCss` and `webcGetJs`](https://www.11ty.dev/docs/languages/webc/#css-and-js-(bundler-mode)) were available to access CSS and JS bundles but are considered deprecated in favor of new bundle plugin Universal Shortcodes `getBundle("css")` and `getBundle("js")` respectively.

#### Bundling on the [Edge](https://www.11ty.dev/docs/plugins/edge/)
Expand Down

0 comments on commit 5ba451c

Please sign in to comment.