Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 11 days 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 (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-22T09:53:55.000Z (8 months ago)
- Last Synced: 2024-12-03T16:44:02.367Z (19 days 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)