# babel-plugin-transform-jsx-m

> Support m with directive. eg: m-style={}

Latest version **0.1.2** (published 2021-11-18) · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-jsx-m
pnpm add babel-plugin-transform-jsx-m
yarn add babel-plugin-transform-jsx-m
bun add babel-plugin-transform-jsx-m
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2021-11-18 |
| First published | 2021-05-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | xiaobc |
| Keywords | babel-plugin |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-jsx-m
- npm.io page: https://npm.io/package/babel-plugin-transform-jsx-m

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2021-11-18
- 0.1.1 — 2021-11-18
- 0.1.0 — 2021-05-07

## README

# babel-plugin-transform-jsx-m

Support m with directive. eg: m-style={}

## Example

**In**

```jsx
import { createElement } from 'react';

export default function Foo(props) {
  const { message } = props;
  return (
    <div m-style={padding:'0px'} style={padding: '20px'}>hello world</div>
  );
}
```

**Out**

```jsx
import { createElement } from 'react';
// PC
export default function Foo(props) {
  const { message } = props;
  return (
    <div style={padding: '20px'}>hello world</div>
  );
}


// Mobile
export default function Foo(props) {
  const { message } = props;
  return (
    <div style={padding: '0px'}>hello world</div>
  );
}
```

## Installation

```sh
$ npm install babel-plugin-transform-jsx-m
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["transform-jsx-m"]
}
```

### Via CLI

```sh
$ babel --plugins transform-jsx-m script.js
```

### Via Node API

```javascript
require("babel-core").transform("code", {
  plugins: ["transform-jsx-m"]
});
```

---
_Source: https://npm.io/package/babel-plugin-transform-jsx-m · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
