https://github.com/chuhoman/vue-demi-component-template
SFC template of vue-demi project, can dev & test & build 编写基于 vue-demi 单文件组件模板库
https://github.com/chuhoman/vue-demi-component-template
vue-demi vuejs
Last synced: 4 months ago
JSON representation
SFC template of vue-demi project, can dev & test & build 编写基于 vue-demi 单文件组件模板库
- Host: GitHub
- URL: https://github.com/chuhoman/vue-demi-component-template
- Owner: ChuHoMan
- License: mit
- Created: 2022-03-20T17:05:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T03:59:56.000Z (5 months ago)
- Last Synced: 2025-03-19T03:53:13.565Z (4 months ago)
- Topics: vue-demi, vuejs
- Language: TypeScript
- Homepage:
- Size: 442 KB
- Stars: 35
- Watchers: 3
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vue-Demi + TS + Vite For SFC template
> Vue.js component template for Vue 2 and 2.7 and 3.
English | 简体中文## Features
- Development environment for library mode in Vue 2.6/2.7/3
- Testing/building environment for library mode in Vue 2/3
- dts solution for library mode in Vue 2.7/3 (partial support for Vue 2.6)
- Script to adapt package.json during release## Template Usage
To use this template, clone it down using:
```bash
npx degit ChuHoMan/vue-demi-component-template my-component
```And do a global replace of `vue-demi-component-template` and `VueDemiComponentTemplate` with your component library name.
## Setup
Make sure to install the dependencies:
```bash
# pnpm
pnpm install
```> ⚠️ Important: If you are using pnpm 10.x, you need to add the following configuration in the package.json of the vue-demi-component-template project:
> ```json
> {
> "pnpm": {
> "onlyBuiltDependencies": ["vue-demi-component-template"]
> }
> }
> ```
> This is because pnpm 10.x blocks postinstall scripts by default, while vue-demi-component-template relies on postinstall scripts to select the appropriate build artifacts for Vue version compatibility. For more details, see [pnpm/pnpm#8897](https://github.com/pnpm/pnpm/pull/8897).## Development Server
Start the development server
```bash
# Vue 2.6.x
pnpm run dev:2
# Vue 2.7.x
pnpm run dev:2.7
# Vue 3
pnpm run dev:3
```## How to use dist file?
### From CDN or without a Bundler
```html
Vite App
const app = Vue.createApp({})
app.use(VueDemiTemplateComponent)
app.mount('#app')
```
## Production
Build the library for production or publish:
```bash
# build all versions
pnpm run build
```## License
Made with 💙
Published under [MIT License](./LICENSE).