vite-plugin-static-filehash
v0.0.3
Published
A Vite plugin that tries to keep the hash of a single file unchanged
Downloads
216
Readme
A Vite plugin that tries to keep the hash of a single file unchanged
When we update our program, if we only change one file, such as modifying the About file, it will still affect the cache hit of the entry file. This is because the hash change of the file affects other files, causing the content of other files to change, and their hashes to change. The change of hash spreads like a virus, affecting all files that depend on it, including the entry file.
So the role of this plugin is that when you modify one file, it will never affect other files.
import {
defineConfig,
} from 'vite'
import react from '@vitejs/plugin-react-swc'
import staticFilehashPlugin from 'vite-plugin-static-filehash';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
staticFilehashPlugin(),
],
})
The effect of not using this plugin:
The effect of using this plugin: