
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
miniprogram-build-npm
Advanced tools
小程序npm支持的改进版。
开发者工具自带的【构建 npm】不支持tree-shaking, 拿redux@3.6.0为例,v3.6.0的redux引入了lodash/isPlainObject, 结果构建npm后整个lodash都被构建进了miniprogram_npm。此库就是为了解决此问题。
$ yarn add miniprogram-build-npm -D
{
"scripts": {
"build-npm": "miniprogram-build-npm"
}
}
$ npm run build-npm
--output/-oType: string Default: miniprogram_npm
构建输出路径
$ miniprogram-build-npm --output libs
--format/-fType: cjs | esm Default: cjs
输出模块格式:
cjs - CommonJSesm - ES, 使用此格式可以配合【ES6转ES5】使用具体输出格式需要看引入的包支持不支持相关格式,如果包本身发布时只发布了es5的格式,那么即使指定esm也无效,会原样打包
$ miniprogram-build-npm --format esm
--sourcemap/-sType: boolean Default: false
开启sourcemap
$ miniprogram-build-npm --sourcemap
除了作为命令行使用,还可以使用api调用
const build = require('miniprogram-build-npm');
build({
output: 'libs',
format: 'esm',
sourcemap: false,
});
FAQs
miniprogram build npm
We found that miniprogram-build-npm 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.