A Vite plugin enabling long-term caching of static assets (JS, CSS) using import maps. Version 0.2.6, actively maintained with weekly releases. Key differentiators: it generates and patches import maps to decouple file hashes from URLs, allowing aggressive caching without cache invalidation. Unlike standard Vite hashing, this plugin splits import map management into generator and patcher plugins, giving fine-grained control over entry points and chunk names. Useful for projects needing maximal cache hit rates, especially with large vendor chunks like monaco-editor.
npm install vite-plugin-long-term-cache-import-mapNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures Vite with import map caching plugins, generating and patching import maps for long-term cache.
Set output.entryFileNames and output.chunkFileNames without [hash] (e.g., 'assets/js/[name].js').
Test all pages after adding manualChunks; ensure all entry points are covered by importMapPatcherPlugin options.
Monitor GitHub for API updates; consider pinning version if stability is critical.
Use assetFileNames function to add [hash] only for .css files (and other non-JS assets if needed).
Run `npm install vite-plugin-long-term-cache-import-map --save-dev` or equivalent for your package manager.
Use `import { importMapGeneratorPlugin, importMapPatcherPlugin } from 'vite-plugin-long-term-cache-import-map'`.Ensure correct named import: `import { importMapPatcherPlugin } from 'vite-plugin-long-term-cache-import-map'`.Pass object with `entryPath` property: `importMapPatcherPlugin({ entryPath: '/assets/js/index.js' })`.No dependency data recorded yet.