# 替换内容

替换业务内容。已不建议使用。

# 如何使用

安装

pnpm add @plugin-light/webpack-loader-replace-content -D

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

const { LOADER: replaceContent } = require('@plugin-light/webpack-loader-replace-content');

module.export = {
  chainWebpack(config) {
    config.module
      .rule('vue')
      .test(/\.vue$/)
      .use(replaceContent)
      .loader(replaceContent)
      .end();
  }
}

# 类型

export type IReplaceList = Array<{
  from: string;
  to: string;
  files: Array<string | RegExp>;
}>;

export type IReplaceContentOptions = {
  replaceList?: IReplaceList
};

# 更新日志

点此查看

Last Updated: 2025/4/18 01:30:08