Skip to content

Commit 60ed610

Browse files
committed
feat: add config root for vite
1 parent 9d59ffa commit 60ed610

File tree

7 files changed

+591
-555
lines changed

7 files changed

+591
-555
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export default {
4242

4343
That's all.
4444

45-
Use components in templates as you would usually do but NO `import` and `component registration` required anymore! It will import components on demand, code spliting is also possible.
45+
Use components in templates as you would usually do but NO `import` and `component registration` required anymore! It will import components on demand, code splitting is also possible.
4646

47-
Basically, it automatically turns this
47+
Basically, it will automatically turn this
4848

4949
```vue
5050
<template>
@@ -87,12 +87,18 @@ The following show the default values of the configuration
8787

8888
```ts
8989
ViteComponents({
90-
// Relative paths to the directory to search for components.
90+
// relative paths to the directory to search for components.
9191
dirs: ['src/components'],
92-
// Valid file extensions for components.
92+
// valid file extensions for components.
9393
extensions: ['vue'],
94-
// Search for subdirectories
94+
// search for subdirectories
9595
deep: true,
96+
97+
// vite config
98+
// currently, vite does not provide an API for plugins to get the config https://github.com/vitejs/vite/issues/738
99+
// you will need to pass `alias` and `root` if you set them in vite config
100+
alias: {},
101+
root: process.cwd(),
96102
})
97103
```
98104

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@
2121
"fixture:dev": "npm -C test/fixture run dev",
2222
"fixture:build": "npm -C test/fixture run build",
2323
"build": "tsup src/index.ts --dts --format cjs,esm",
24-
"prepublish": "npm run build",
24+
"prepare": "npm run build",
2525
"release": "standard-version && npm publish && git push"
2626
},
2727
"dependencies": {
28-
"debug": "^4.1.1",
28+
"debug": "^4.3.0",
2929
"fast-glob": "^3.2.4",
3030
"minimatch": "^3.0.4"
3131
},
3232
"devDependencies": {
33-
"@antfu/eslint-config": "^0.3.2",
33+
"@antfu/eslint-config": "^0.4.3",
3434
"@types/debug": "^4.1.5",
3535
"@types/minimatch": "^3.0.3",
36-
"@typescript-eslint/eslint-plugin": "^3.9.1",
37-
"eslint": "^7.7.0",
38-
"rollup": "^2.26.4",
36+
"@typescript-eslint/eslint-plugin": "^4.5.0",
37+
"eslint": "^7.11.0",
38+
"rollup": "^2.32.1",
3939
"standard-version": "^9.0.0",
40-
"tsup": "^3.6.1",
41-
"typescript": "^3.9.7",
40+
"tsup": "^3.7.0",
41+
"typescript": "^4.0.3",
4242
"vite": "^1.0.0-rc.4"
4343
}
4444
}

0 commit comments

Comments
 (0)