A VueJS 3.0 building template to create your own components library.
- Vuejs 3.0 Based Library Template
- Typescript support
- Using Rollup to create final bundle ( based on shubhadip rollup setup shubhadip/vue3-component-library )
- Using PostCSS to include CSS Files
- Minified Build
- Includes VuePress for documenting your library
This is a guide of how to setup and build your library project Multiple components can be included in the library.
Each component has a seperated folder add inside the components folder. Inside each component's folder, its .vue file and .css files are included. In addition an index.ts file exports the specified component in the final bundle.
Each of there Components are also included as exports in the index.ts file located inside the /components folder
npm run install
npm run build
At the VueJS Initialization on the main.ts or .js file of the project add the following.
import { TestWorld } from 'vue3-component-library';
...
app.use(TestWorld)
When you want to import a specific component from the library into a dedicated place inside your code
import { TestWorld } from 'vue3-component-library';
...
components:{
TestWorld
}
In order to run the Vuepress development server
npm run docs:dev
In order to build the final docs
npm run docs:build