https://github.com/recallwei/unplugin-auto-import-ahooks
🔧 unplugin-auto-import-ahooks is a resolver for unplugin-auto-import that enables on-demand importing of ahooks.
https://github.com/recallwei/unplugin-auto-import-ahooks
ahooks unplugin-auto-import unplugin-auto-import-ahooks
Last synced: 12 months ago
JSON representation
🔧 unplugin-auto-import-ahooks is a resolver for unplugin-auto-import that enables on-demand importing of ahooks.
- Host: GitHub
- URL: https://github.com/recallwei/unplugin-auto-import-ahooks
- Owner: recallwei
- License: mit
- Created: 2023-11-16T03:11:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T09:53:55.000Z (over 2 years ago)
- Last Synced: 2025-08-02T18:19:23.765Z (12 months ago)
- Topics: ahooks, unplugin-auto-import, unplugin-auto-import-ahooks
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/unplugin-auto-import-ahooks
- Size: 124 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# unplugin-auto-import-ahooks
English / [ç®€ä½“ä¸æ–‡](./README.zh-CN.md)
`unplugin-auto-import-ahooks` is a resolver for [unplugin-auto-import](https://github.com/unplugin/unplugin-auto-import) that enables on-demand importing of ahooks.
## Features
- Support `Vite`, `Webpack` and more
- Automatically imports hooks from `ahook`
## Installation
### npm
```bash
npm i -D unplugin-auto-import-ahooks unplugin-auto-import
```
### yarn
```bash
yarn add -D unplugin-auto-import-ahooks unplugin-auto-import
```
### pnpm
```bash
pnpm add -D unplugin-auto-import-ahooks unplugin-auto-import
```
### bun
```bash
bun add -D unplugin-auto-import-ahooks unplugin-auto-import
```
## Usage
### Vite
```ts
// vite.config.ts
import AutoImport from 'unplugin-auto-import/vite'
import AhooksResolver from 'unplugin-auto-import-ahooks'
export default defineConfig({
plugins: [
AutoImport({
resolvers: [AhooksResolver()]
})
]
})
```
### Webpack
```js
// webpack.config.js
const AhooksResolver = require('unplugin-auto-import-ahooks')
module.exports = {
/* ... */
plugins: [
require('unplugin-auto-import/webpack')({
resolvers: [AntdAhooksResolverResolver()]
})
]
}
```
## License
[MIT](/LICENSE) License © 2024 [Bruce Song](https://github.com/recallwei)