@plugin-light/webpack-plugin-modify-html
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

HTML 修改

可以修改构建后的html,插入一些内容。

如何使用

安装

pnpm add @plugin-light/webpack-plugin-modify-html -D

vue.config.js 中添加如下设置:

const { HtmlModifyPlugin } = require('@plugin-light/webpack-plugin-modify-html');


module.exports = {
  chainWebpack(config) {
    config.plugin('HtmlModify')
      .use(new HtmlModifyPlugin({
        onEnd: {
          html: [{
            source: path.resolve(curDirname, 'src', getRealVueAppDir(), 'index.html'),
            destination: `${getOutputPath()}/index.html`,
            ssr: process.env.VUE_APP_SSR,
            urls: getCdnInject({ isVue3 }).cdnUrls,
          }],
        },
      }))
      .tap(args => args);
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @plugin-light/webpack-plugin-modify-html

Weekly Downloads

66

Version

0.0.4

License

none

Unpacked Size

12.9 kB

Total Files

5

Last publish

Collaborators

  • yanggwcn