vite-plugin-public-path

JSON →
library 1.1.0 ·javascript
verified Jun 4, 2026

A Vite plugin that provides the equivalent of Webpack's __webpack_public_path__, allowing dynamic resolution of asset base path at runtime (e.g., loading from CDN). Version 1.1.0, actively maintained with steady updates. Ships TypeScript types and supports both modern and legacy builds (via @vitejs/plugin-legacy). Requires Vite >=2.8 as a peer dependency. Key differentiator: works for index.html and legacy bundles, not just JavaScript chunks.