Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-preset-es2015-tiny

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-es2015-tiny

Babel preset for some es2015 plugins not includes Symbol and Generators.

  • 6.9.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

babel-preset-es2015-tiny

这是一个 Babel preset, 它是 ES2015 preset 的子集。

它不包含下面这些 ES2015 preset 中的 transform 插件:

为什么要这样做?

当你结合 transform-runtime 一起使用 ES2015 preset 的时候, Symbol shim 会被加入到最终的打包文件中, 即使你的项目里完全没有用到过它。

为了避免这个情况, 所以需要删除与 Symbol 相关的 transform 插件, 详情见这篇博文

如果你的项目里没有用到 for...ofSymbol、Generators 函数和 async/await, 你可以使用 es2015-tiny 来减小最终文件体积。

安装

$ npm install --save-dev babel-preset-es2015-tiny

使用

配置 .babelrc (推荐)

{
  "presets": ["es2015-tiny"]
}

命令行

$ babel script.js --presets es2015-tiny

Node API

require("babel-core").transform("code", {
  presets: ["es2015-tiny"]
});

FAQs

Package last updated on 05 Jul 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc