diff options
author | 2021-07-14 13:41:51 -0400 | |
---|---|---|
committer | 2021-07-14 13:41:51 -0400 | |
commit | d40edb0b673f380c9eb9c07add3e0cd2371d9623 (patch) | |
tree | 0ec0d3487ac15cb609402f2f4f7e9c6fd5a6227b /docs/guides/publish-to-npm.md | |
parent | d07f3d4186ee0ffe5acb74ebc76c15a5611268fa (diff) | |
download | astro-d40edb0b673f380c9eb9c07add3e0cd2371d9623.tar.gz astro-d40edb0b673f380c9eb9c07add3e0cd2371d9623.tar.zst astro-d40edb0b673f380c9eb9c07add3e0cd2371d9623.zip |
Docs sync (#680)
* test ignoring examples from workspace
* docs sync
Diffstat (limited to 'docs/guides/publish-to-npm.md')
-rw-r--r-- | docs/guides/publish-to-npm.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/guides/publish-to-npm.md b/docs/guides/publish-to-npm.md index 7c52fec02..aebf0311a 100644 --- a/docs/guides/publish-to-npm.md +++ b/docs/guides/publish-to-npm.md @@ -1,11 +1,11 @@ --- layout: ~/layouts/Main.astro -title: Publish Components to NPM +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 |