2.1.0 • Published 4 years ago
vite-plugin-rehost v2.1.0
vite-plugin-rehost
Self-hosted resources from index.html
Any <link rel="stylesheet"> and <script> elements that point to external URLs are fetched
at build time and saved to the outDir to be self-hosted. The resources will have a content
hash in their name, so Cache-Control: immutable can be used.
Within self-hosted .css files, any url() expressions that point to external URLs are also
fetched and saved to the outDir to be self-hosted.
Note: This plugin depends on #1675
Usage
yarn add vite-plugin-rehost -DWithin your vite.config.js file:
import rehost from 'vite-plugin-rehost'
export default {
plugins: [
rehost(),
]
}