This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
- VS Code + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Follow this guide to publish your Storybook library to NPM, making it available for others to easily npm install.
Ensure you have an account on npm. If not, you can create one for free. Verify node and npm installations:
Copy code
node -v
npm -v
a. Building the Library Compile your library with Vite or your bundler:
vite build
b. Update package.json Ensure the following fields are set:
name: Name of your package. version: Version number. main: Main entry file (e.g., dist/index.js). files: Files to include, e.g., ["dist"].
Login to npm (if you haven't already):
npm login
Provide your username, password, and email.
a. Default (Private Package) For scoped private packages (@username/project-name):
npm publish
b. Public Package For public packages:
npm publish --access=public
Check on the npm website to verify your package's publication.
Check the registry name
npm get registry
To install the library:
npm install your-library-name
Users can then import and utilize your library's components.
Notes:
Always update the version in package.json before republishing. Ensure only necessary files are bundled to prevent package bloat.