1.0.2 • Published 3 years ago

vite-plugin-entry-inject v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

vite-plugin-entry-inject

修改打包后入口文件在html中的注入位置

使用说明

npm install --save-dev vite-plugin-entry-inject
# or
yarn add vite-plugin-entry-inject -D
// vite.config.js
import VitePluginEntryInject from 'vite-plugin-entry-inject';

export default {
    plugins: [{
        VitePluginEntryInject({
            // head-prepend/head/body-prepend/body
            injectTo: 'body'
        })
    }]
};

参数

injectTo

  • Type: string
  • Default: body

入口文件注入位置,默认body,即body闭合标签</body>前,可选。

  • head-prepend: <head>开始标签后
  • head: </head>闭合标签前
  • body-prepend: <body>开始标签后
  • body: </body>闭合标签前