Skip to content

Commit 26b2e9a

Browse files
committed
chore: 0.1.0
0 parents  commit 26b2e9a

15 files changed

+3906
-0
lines changed

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@antfu/eslint-config-ts"
3+
}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.DS_Store
3+
dist

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Anthony Fu<https://github.com/antfu>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<h1 align='center'>vite-plugin-components</h1>
2+
3+
<p align='center'>Vite plugin for components auto importing</p>
4+
5+
<br>
6+
7+
## Usage
8+
9+
Install
10+
11+
```bash
12+
npm i vite-plugin-components -D # yarn add vite-plugin-components -D
13+
```
14+
15+
Add it to `vite.config.js`
16+
17+
```ts
18+
// vite.config.js
19+
import { VitePluginComponents } from 'vite-plugin-components'
20+
21+
export default {
22+
plugins: [
23+
VitePluginComponents()
24+
]
25+
}
26+
```
27+
28+
Import and install `vite-plugin-components` in your `main.js`
29+
30+
```ts
31+
import { createApp } from 'vue'
32+
import App from './App.vue'
33+
34+
import components from 'vite-plugin-components' // <-- This
35+
36+
const app = createApp(App)
37+
38+
app.use(components) // <-- and this
39+
40+
app.mount('#app')
41+
```
42+
43+
## Configuration
44+
45+
The following show the default values of the configuration
46+
47+
```ts
48+
VitePluginComponents({
49+
// Relative path to the directory to search for components.
50+
dirs: ['src/components'],
51+
// Valid file extensions for components.
52+
extensions: ['vue'],
53+
// Search for subdirectories
54+
deep: true,
55+
})
56+
```
57+
58+
## Example
59+
60+
See the [Vitesse](https://github.com/antfu/vitesse) starter template.
61+
62+
## Thanks
63+
64+
Thanks to [@brattonross](https://github.com/brattonross), this project is heavily inspired by [vite-plugin-voie](https://github.com/vamplate/vite-plugin-voie).
65+
66+
## License
67+
68+
MIT License © 2020 [Anthony Fu](https://github.com/antfu)

package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "vite-plugin-components",
3+
"version": "0.1.0",
4+
"main": "dist/index.js",
5+
"module": "dist/index.mjs",
6+
"types": "dist/index.d.ts",
7+
"license": "MIT",
8+
"author": "antfu <[email protected]>",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/antfu/vite-plugin-components"
12+
},
13+
"homepage": "https://github.com/antfu/vite-plugin-components",
14+
"bugs": "https://github.com/antfu/vite-plugin-components/issues",
15+
"files": ["dist"],
16+
"scripts": {
17+
"dev": "npm run build -- --watch",
18+
"build": "tsup src/index.ts --dts --format cjs,esm",
19+
"prepublish": "npm run build"
20+
},
21+
"devDependencies": {
22+
"@antfu/eslint-config-ts": "^0.3.2",
23+
"@typescript-eslint/eslint-plugin": "^3.9.1",
24+
"eslint": "^7.7.0",
25+
"rollup": "^2.26.4",
26+
"tsup": "^3.6.1",
27+
"typescript": "^3.9.7",
28+
"vite": "^1.0.0-rc.4"
29+
},
30+
"dependencies": {
31+
"fast-glob": "^3.2.4"
32+
}
33+
}

0 commit comments

Comments
 (0)