1.1.2 • Published 9 months ago

vite-resource-preload v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

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

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago