vite-resource-preload
v1.1.4
Published
资源文件预加载
Downloads
23
Readme
vite-resource-preload 资源文件预加载
Installation
yarn add vite-resource-preload --dev
or
npm i vite-resource-preload -D
Usage
Configuration
// vite.config.js
import { defineConfig } from "vite";
import preload from "vite-resource-preload";
export default defineConfig({
plugins: [ preload()],
});
Html before:
<html>
<head>
<title>example</title>
<link rel="modulepreload" href="/assets/vendor-59615c78f7be.js" />
<link rel="stylesheet" href="/assets/index-9aeb83991564.css" />
</head>
<body>
<div id="app"></div>
</body>
</html>
Html after:
<html>
<head>
<title>example</title>
<link rel="modulepreload" href="/assets/vendor-59615c78f7be.js" />
<link rel="stylesheet" href="/assets/index-9aeb83991564.css" />
<link rel="modulepreload" href="/assets/index.e97d0920f847.js" />
<link rel="modulepreload" href="/assets/index.76fa5012707d.js" />
<link rel="modulepreload" href="/assets/index.cc263332bc0d.js" />
<link rel="stylesheet" href="/assets/index.1715157f8e60.css" />
</head>
<body>
<div id="app"></div>
</body>
</html>