
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
babel-preset-mp
Advanced tools
微信小程序 babel 构建环境预设
官方repo地址,该repo是官方包的修复版本。
npm install --save-dev babel-preset-mp
// babel.config.js
module.exports = {
presets: [
[
'babel-preset-miniprogram',
{
wechatLibVersion: '2.14.0', // 指定小程序最低基础库版本
useBuiltIns: 'usage', // 打入 Polyfill
modules: 'cjs', // 将代码转义为 commonjs
},
],
],
};
wechatLibVersion: string
指定构建小程序的目标最低基础库版本,可以在 小程序管理页 【设置】-【基本设置】-【基础库最低版本设置】中设置你的小程序最低版本
其余配置项可直接使用 @babel/preset-env
配置项
由于小程序基础库版本会与小程序运行环境版本绑定,因此特定小程序基础库可能的运行环境是确定的。
该预设便是利用该信息,只将运行环境必要的转义和 Polyfill 设置给 @babel/preset-env
,从而尽可能减少编译处理和小程序代码体积。
另外由于小程序基础库本身自带了一个 Polyfill,该预设也会避免打入不必要的 Polyfill。
FAQs
微信小程序 babel 构建环境预设
The npm package babel-preset-mp receives a total of 0 weekly downloads. As such, babel-preset-mp popularity was classified as not popular.
We found that babel-preset-mp 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.