diff options
author | 2021-07-14 17:43:06 +0000 | |
---|---|---|
committer | 2021-07-14 17:43:06 +0000 | |
commit | 1583ef173ae36eb9f325c2d163df17ea49e244a9 (patch) | |
tree | b97a58f9e0004ffb208c4cf5db31d0c4215f9418 /docs/guides/publish-to-npm.md | |
parent | d40edb0b673f380c9eb9c07add3e0cd2371d9623 (diff) | |
download | astro-1583ef173ae36eb9f325c2d163df17ea49e244a9.tar.gz astro-1583ef173ae36eb9f325c2d163df17ea49e244a9.tar.zst astro-1583ef173ae36eb9f325c2d163df17ea49e244a9.zip |
[ci] yarn format
Diffstat (limited to 'docs/guides/publish-to-npm.md')
-rw-r--r-- | docs/guides/publish-to-npm.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/guides/publish-to-npm.md b/docs/guides/publish-to-npm.md index aebf0311a..86e5400f7 100644 --- a/docs/guides/publish-to-npm.md +++ b/docs/guides/publish-to-npm.md @@ -3,9 +3,9 @@ layout: ~/layouts/Main.astro title: Publish a Component to NPM --- -Built a great Astro component? **Publish it to [npm!](https://npmjs.com/)** +Built a great Astro component? **Publish it to [npm!](https://npmjs.com/)** -Once published to npm, Astro components can be installed and used in your project like any other npm package. npm is a great way to share Astro components across projects within your team, your company, or the entire world. +Once published to npm, Astro components can be installed and used in your project like any other npm package. npm is a great way to share Astro components across projects within your team, your company, or the entire world. ## Basic NPM Package Setup @@ -66,7 +66,7 @@ import Capitalize from '@example/my-components/Capitalize.astro'; <Capitalize phrase={`Hello world`} /> ``` -This is a less common scenario, and we only recommend it if you have good reason. Because Astro is completely rendered at build-time, there are no client-side performance concerns to our default recommendation to export your components from a single `index.js` file. +This is a less common scenario, and we only recommend it if you have good reason. Because Astro is completely rendered at build-time, there are no client-side performance concerns to our default recommendation to export your components from a single `index.js` file. To support importing by file within your package, add each file to your **package.json** `exports` map: @@ -80,4 +80,4 @@ To support importing by file within your package, add each file to your **packag + "./Capitalize.astro": "./Capitalize.astro" } } -```
\ No newline at end of file +``` |