Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/irabbi360/vue-npm-package-starter
Create and Publish a Vue NPM Package
https://github.com/irabbi360/vue-npm-package-starter
cretae-vue-npm-package npm npm-package-builder npm-package-generator vue-npm-package-starter
Last synced: 13 days ago
JSON representation
Create and Publish a Vue NPM Package
- Host: GitHub
- URL: https://github.com/irabbi360/vue-npm-package-starter
- Owner: irabbi360
- License: mit
- Created: 2024-12-05T09:26:20.000Z (23 days ago)
- Default Branch: main
- Last Pushed: 2024-12-05T10:18:35.000Z (23 days ago)
- Last Synced: 2024-12-05T10:32:47.610Z (23 days ago)
- Topics: cretae-vue-npm-package, npm, npm-package-builder, npm-package-generator, vue-npm-package-starter
- Language: CSS
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vue NPM Package Starter
## How to Create and Publish a Vue NPM Package
To create a Vue.js npm package using this repository, simply modify the contents of the lib folder in the root directory. Inside, you'll find an example of a Vue component that you can use as a template for building your own Vue NPM package.
- Rename the VueExampleNpm.vue file: Change the filename to match your desired package name.
- Update the lib/main.ts file: Modify the file to reflect the new package name where necessary.
- Update the package.json: In the package.json file, replace any occurrence of vue-example-npm with your new package name.## Test the Library
We can now run `npm run build` and test our library. To do this, open up a Vue project (you can open a current Vue 3 project you have, or create a blank one).## How to Publish to NPM
If you haven't signed into NPM inside your terminal, you can run the `npm adduser` command.
Then just run the `npm publish` command and the package should be pushed up and made available on NPM.
## Installation Instructions
`npm i vue-example-npm`
## Usage in Vue.js or Nuxt.js Projects
Once installed, you can import and use the component like this:`import VueExampleNpm from 'vue-example-npm'`
`import 'vue-example-npm/dist/style.css`