2.1.1 • Published 11 months ago

webpack-detection-field-plugin v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

安装

yarn add webpack-detection-field-plugin -D

DetSpecInfoStopPlugin

DetSpecInfoStopPlugin 检测项目中的指定的 字符 ,如果存在则终止打包。

参数: options

参数字段参数类型参数说明参数值
specifiedInfostring[]项目中索要检测匹配的字段eg: "test"

用法:

const { DetSpecInfoStopPlugin } = require("webpack-detection-field-plugin")

// webpack.config.js
module.exports = {
  ...
  plugins: [
    ...,
    new DetSpecInfoStopPlugin({
      specifiedInfo: ["test"]
    })
  ]

}

ReplaceSpecifiedInfoPlugin

ReplaceSpecifiedInfoPlugin 检测项目中的指定的 字符 ,若存在指定的字符支持两种操作:

  1. 替换为指定的字符,targetText
  2. 终止打包,isStopPackaging

参数: options

参数字段参数类型参数说明参数值
replaceTextArrstring[]项目中索要检测匹配的字段eg: "test"
targetTextstring替换为指定的字符eg: "just do it!"
isStopPackagingboolean是否终止打包eg: false
checkFileTypestring[]检测的文件类型eg: "js","css","html"

用法:

const { ReplaceSpecifiedInfoPlugin } = require("webpack-detection-field-plugin")

// webpack.config.js
module.exports = {
  ...
  plugins: [
    ...,
    new ReplaceSpecifiedInfoPlugin({
      replaceTextArr: ["test"],
      targetText: "just",
      isStopPackaging: false
    })
  ]

}
2.1.1

11 months ago

2.1.0

11 months ago

2.0.0

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago