WebC v0.6.2: webc:import from npm
Import directly from npm
This example uses @11ty/[email protected]
.
<syntax-highlight language="js" webc:import="npm:@11ty/eleventy-plugin-syntaxhighlight">
function myFunction() {
return true;
}
</syntax-highlight>
Uses the component tag name (syntax-highlight
) to look for a WebC component at node_modules/@11ty/eleventy-plugin-syntaxhighlight/syntax-highlight.webc
and imports it for use.
This works with webc:is
too:
<template webc:is="syntax-highlight" language="js" webc:import="npm:@11ty/eleventy-plugin-syntaxhighlight">
- The WebC standalone docs (and Eleventy
webc:import
docs and Syntax Highlighter plugin docs) have been updated.
Other Changes
- Fix for void elements WebC components that use render functions #67
- chore: copy examples to folder by @manekinekko in #12
- chore: caches node modules in GitHub Actions workflow by @kleinfreund in #43
- Milestone: https://github.com/11ty/webc/milestone/10?closed=1
- Full Changelog: v0.6.1...v0.6.2