https://github.com/alloc/vite-plugin-public
Postprocessing for /public
https://github.com/alloc/vite-plugin-public
Last synced: 11 months ago
JSON representation
Postprocessing for /public
- Host: GitHub
- URL: https://github.com/alloc/vite-plugin-public
- Owner: alloc
- License: mit
- Created: 2021-01-20T19:55:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-23T18:58:20.000Z (about 5 years ago)
- Last Synced: 2025-02-11T23:57:37.435Z (12 months ago)
- Language: TypeScript
- Homepage:
- Size: 18.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-public
[](https://www.npmjs.com/package/vite-plugin-public)
[](https://github.com/prettier/prettier)
[](https://paypal.me/alecdotbiz)
> Postprocessing for /public
### Usage
The `publicHash` plugin helps you add content hashes to all or some files
from the `/public` directory.
**Note:** This plugin depends on [#1647](https://github.com/vitejs/vite/pull/1647) and [#1675](https://github.com/vitejs/vite/pull/1675)
#### Options
- `ignore?: RegExp`
Matching files are not hashed.
- `skipRename?: boolean`
Rewrite URLs but skip renaming files in `outDir`.
Useful when your Vite config is loaded more than once.
```ts
import {publicHash} from 'vite-plugin-public'
export default {
plugins: [
publicHash({
ignore: /^static\//,
}),
]
}
```
Other plugins may be added in the future. Ideas and contributions welcome!