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

cube-babel

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cube-babel

cube babel processor

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by128.57%
Maintainers
2
Weekly downloads
 
Created
Source

cube-babel

babel转换器, 配置的config参数,和babel一致,请参考babel-core的用法

case 配置普通转换

注意工程中需要安装: @babel/preset-env

{
  "cube": {
    "processors": {
      ".js": [
        "cube-babel",
        {
          "presets": [
             ["env", {"targets": {"browsers": ["chrome >= 50", "safari >= 7"]}}]
          ]
        }
      ]
    }
  }
}

case 配置react转换

注意工程中需要安装: @babel/preset-env @babel/preset-react

{
  "cube": {
    "processors": {
      ".js": [
        "cube-babel",
        {
          "presets": [
            "react",
            ["env", {"targets": {"browsers": ["chrome >= 50", "safari >= 7"]}}]
          ]
        }
      ]
    }
  }
}

详细配置

usage:

{
  cube: {
    processors: {
      '.js': [
        [
          'cube-babel', 
          {
            presets: [],
            plugins: [
              ['${plugin-name}', {/** ${config} **/}]
            ]
          }
        ]
      ]
    }
  }
}

更多配置,请参考babel文档 https://babeljs.io/docs/en/presets

FAQs

Package last updated on 25 May 2021

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