Skip to content

Commit

Permalink
docs: Add esm.sh instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Sep 21, 2023
1 parent ed23f00 commit cabe233
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions website/src/components/PkgTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default function PkgTabs({ pkgs, dev = false }) {
values={[
{ label: 'NPM', value: 'npm' },
{ label: 'Yarn', value: 'yarn' },
{ label: 'esm.sh', value: 'esm' },
]}
>
<TabItem value="yarn">
Expand All @@ -24,6 +25,16 @@ export default function PkgTabs({ pkgs, dev = false }) {
npm install --save{dev ? 'Dev ' : ''} {pkgs}
</CodeBlock>
</TabItem>
<TabItem value="esm">
<CodeBlock className="language-html">
{`<script type="module">
${pkgs
.split(' ')
.map(pkg => ` import * from 'https://esm.sh/${pkg}${dev ? '?dev' : ''}';`)
.join('\n')}
</script>`}
</CodeBlock>
</TabItem>
</Tabs>
);
}

0 comments on commit cabe233

Please sign in to comment.