
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
babel-preset-h5
Advanced tools
相关依赖:
如果你应用中 package.json 已经包含上述某几个依赖,请从 package.json 中移除这些依赖。 安装 babel-preset-h5 时会自动安装上述所有依赖。
要求 npm 版本 5.0+
npx install-peerdeps --dev babel-preset-h5
// .babelrc
{
"presets": [
"babel-preset-h5"
]
}
搞定!
| 选项 | 含义 | 默认值 |
|---|---|---|
| targets | 代码运行需要支持的环境 | ['last 2 versions', '> 1%', 'ie >= 11'] |
| useTypeScript | 是否使用 TypeScript | true |
| useReact | 是否使用 React | true |
指定环境变量,有助于减少线上包的大小。
比如你可以在 webpack.config.js 中,显示指定环境变量
process.env.BABEL_ENV = "production";
process.env.NODE_ENV = "production";
支持最新的 JavaScript 标准。除了 ES6 语法功能外,它还支持:
不支持 Proxy, 不支持 BigInt, 不支持装饰器
FAQs
common h5 app babel preset, support latest ES2021
The npm package babel-preset-h5 receives a total of 1 weekly downloads. As such, babel-preset-h5 popularity was classified as not popular.
We found that babel-preset-h5 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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.