Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@farmfe/js-plugin-babel

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@farmfe/js-plugin-babel

farm plugin which support use babel

latest
npmnpm
Version
0.0.3
Version published
Maintainers
0
Created
Source

@farmfe/js-plugin-babel

farm plugin which support use babel

Install

npm i @farmfe/js-plugin-babel -D

or yarn/pnpm

pnpm i @farmfe/js-plugin-babel -D

Usage

// farm.config.ts
import { babel } from "@farmfe/js-plugin-babel";
import react from "@farmfe/plugin-react";

defineConfig({
  plugins: [
    // transform by babel, default transform `js`, `jsx`, `ts`, `tsx` files
    babel(),
    // transform react
    react(),
  ],
});

Options

filters

  • Type: { moduleTypes: ModuleType[], resolvedPaths: string[] }
  • Default:
{
    moduleTypes: ["js", "jsx", "ts", "tsx"],
    resolvedPaths: []
}

Determines which files to transform

For example, files with the tsx extension

{
  resolvedPaths: [".tsx$"];
}

Or use module types to distinguish

{
  moduleTypes: ["tsx", "jsx"];
}

The type comes from the return value of the load hook and can be customized (farm has some default types js, jsx, ts, tsx, css, html, asset, runtime that can be used directly)

transformOptions

Babel transform configuration

priority

  • Type: number
  • Default: 99

The priority of the farm plugin execution, the higher the priority, the earlier it executes.

name

  • Type: string
  • Default: js-plugin:babel

The name of the farm plugin

Keywords

babel

FAQs

Package last updated on 25 Dec 2024

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