0.0.4 • Published 9 months ago

@plugin-light/webpack-plugin-modify-html v0.0.4

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

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);
  }
}
0.0.4

9 months ago