
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
test-build-plugin
Advanced tools
代码打包检查工具,通过一些简单的配置,在打包的过程中检查,检查webpack的配置项是否正确,打包后的代码是否符合要求。
npm install --save-dev test-build-plugin
1)在项目的根目录中建立.testBuildConfig.js
2)在.testBuildConfig.js配置打包时的检查项
const path = require('path')
const resolvePath = dir => path.join(__dirname, dir)
module.exports = {
// webpack 打包配置项
options: {
entry: {
app: ''
},
output: {
path: resolvePath(''),
publicPath: ''
}
},
codeRules: {
// 用来配置必须有的代码,test: 检测的范围;val: 代码
mustHave: [{
test: /index\.html$/,
val: ['abcdefg']
}],
// 用来配置必须禁止的代码,test: 检测的范围;val: 代码
mustForbidden: [{
test: /\.(js|html)$/,
val: ['beta-api.m.jd.com']
}]
}
}
3)项目中引用
const TestBuildPlugin = require('test-build-plugin')
config.plugins.push(
new TestBuildPlugin()
)
4)在打包指令中添加testBuild=1,比如:
"scripts": node build/build.js --testBuild"
}
根据指令参数是否引入插件
if (process.argv && process.argv.indexOf('--testBuild') > -1) {
config.plugins.push(new TestBuildPlugin())
}
FAQs
code build test tool
We found that test-build-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.