Skip to content

WebC v0.6.2: webc:import from npm

Compare
Choose a tag to compare
@zachleat zachleat released this 02 Nov 15:34
· 131 commits to main since this release

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">

Other Changes