Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-components

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-components - npm Package Compare versions

Comparing version 0.0.0 to 0.1.0

dist/index.d.ts

33

package.json
{
"name": "vite-plugin-components",
"version": "0.0.0",
"main": "index.js",
"license": "MIT"
"version": "0.1.0",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"license": "MIT",
"author": "antfu <anthonyfu117@hotmail.com>",
"repository": {
"type": "git",
"url": "https://github.com/antfu/vite-plugin-components"
},
"homepage": "https://github.com/antfu/vite-plugin-components",
"bugs": "https://github.com/antfu/vite-plugin-components/issues",
"files": ["dist"],
"scripts": {
"dev": "npm run build -- --watch",
"build": "tsup src/index.ts --dts --format cjs,esm",
"prepublish": "npm run build"
},
"devDependencies": {
"@antfu/eslint-config-ts": "^0.3.2",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"eslint": "^7.7.0",
"rollup": "^2.26.4",
"tsup": "^3.6.1",
"typescript": "^3.9.7",
"vite": "^1.0.0-rc.4"
},
"dependencies": {
"fast-glob": "^3.2.4"
}
}

@@ -1,1 +0,68 @@

Placeholder
<h1 align='center'>vite-plugin-components</h1>
<p align='center'>Vite plugin for components auto importing</p>
<br>
## Usage
Install
```bash
npm i vite-plugin-components -D # yarn add vite-plugin-components -D
```
Add it to `vite.config.js`
```ts
// vite.config.js
import { VitePluginComponents } from 'vite-plugin-components'
export default {
plugins: [
VitePluginComponents()
]
}
```
Import and install `vite-plugin-components` in your `main.js`
```ts
import { createApp } from 'vue'
import App from './App.vue'
import components from 'vite-plugin-components' // <-- This
const app = createApp(App)
app.use(components) // <-- and this
app.mount('#app')
```
## Configuration
The following show the default values of the configuration
```ts
VitePluginComponents({
// Relative path to the directory to search for components.
dirs: ['src/components'],
// Valid file extensions for components.
extensions: ['vue'],
// Search for subdirectories
deep: true,
})
```
## Example
See the [Vitesse](https://github.com/antfu/vitesse) starter template.
## Thanks
Thanks to [@brattonross](https://github.com/brattonross), this project is heavily inspired by [vite-plugin-voie](https://github.com/vamplate/vite-plugin-voie).
## License
MIT License © 2020 [Anthony Fu](https://github.com/antfu)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc