code_vite-plugin-uni-components
v1.0.0
Published
Forked from [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) and modified to adapt UniApp.
Downloads
3
Readme
@uni-helper/vite-plugin-uni-components
Forked from unplugin-vue-components and modified to adapt UniApp.
Install
pnpm i -D @uni-helper/vite-plugin-uni-components
Usage
// vite.config.ts
import { defineConfig } from 'vite'
import Uni from '@dcloudio/vite-plugin-uni'
import Components from '@uni-helper/vite-plugin-uni-components'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
// make sure put it before `Uni()`
Components(),
Uni(),
],
})
Component type prompt
If you use pnpm
, please create a .npmrc
file in root, see issue.
// .npmrc
public-hoist-pattern[]=@vue*
// or
// shamefully-hoist = true
see more in unplugin-vue-components