https://github.com/cyansalt/vite-plugin-auto-preload
Vite plugin for adding preload resource hints in HTML
https://github.com/cyansalt/vite-plugin-auto-preload
Last synced: 7 months ago
JSON representation
Vite plugin for adding preload resource hints in HTML
- Host: GitHub
- URL: https://github.com/cyansalt/vite-plugin-auto-preload
- Owner: CyanSalt
- License: isc
- Created: 2023-10-23T03:30:29.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T04:01:03.000Z (about 2 years ago)
- Last Synced: 2025-03-04T19:42:14.449Z (over 1 year ago)
- Language: TypeScript
- Size: 303 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-auto-preload
[](https://www.npmjs.com/package/vite-plugin-auto-preload)
Vite plugin for adding preload resource hints in HTML.
Preload or module preload links are always generated at the end of head. You can refer to [`vite-plugin-html-sort-tags`](https://github.com/CyanSalt/vite-plugin-html-sort-tags) if you want to optimize the sorting.
Also see [`vite-plugin-prefetch-chunk`](https://github.com/CyanSalt/vite-plugin-prefetch-chunk) if you want to generate prefetch links.
## Installation
```shell
npm install --save-dev vite-plugin-auto-preload
```
## Usage
```js
// vite.config.js
import autoPreload from 'vite-plugin-auto-preload'
export default {
plugins: [
autoPreload(),
],
}
```