Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.11 KB

README.md

File metadata and controls

36 lines (25 loc) · 1.11 KB

vite-plugin-rehost

npm Code style: Prettier Donate

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 -D

Within your vite.config.js file:

import rehost from 'vite-plugin-rehost'

export default {
  plugins: [
    rehost(),
  ]
}