# babel-plugin-transform-strip-block

> A Babel Plugin to strip blocks of code marked by special comment tags.

Latest version **0.0.5** (published 2021-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-strip-block
pnpm add babel-plugin-transform-strip-block
yarn add babel-plugin-transform-strip-block
bun add babel-plugin-transform-strip-block
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2021-12-22 |
| First published | 2020-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 10.0.0 |
| Dependencies | 2 |
| Unpacked size | 29.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | felix-kaestner |
| Keywords | babel-plugin, babel-transform |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-strip-block
- Homepage: https://github.com/felix-kaestner/babel-plugin-transform-strip-block
- npm.io page: https://npm.io/package/babel-plugin-transform-strip-block

## Dependencies (2)

- [@babel/types](https://npm.io/package/@babel/types.md) ^7.16.0
- [@babel/helper-plugin-utils](https://npm.io/package/@babel/helper-plugin-utils.md) ^7.16.5

## 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.0.5 (latest) — 2021-12-22
- 0.0.4 — 2020-10-02
- 0.0.3 — 2020-09-27
- 0.0.2 — 2020-09-27
- 0.0.1 — 2020-09-27

## README

# babel-plugin-transform-strip-block

> Strip blocks of code marked by special comment tags.

Using npm:

```sh
npm install --save-dev babel-plugin-transform-strip-block
```

or using yarn:

```sh
yarn add babel-plugin-transform-strip-block --dev
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": [
    [ "babel-plugin-transform-strip-block", { "requireDirective": true, "identifiers": [{ "start": "block:start", "end": "block:end" }] }]
  ]
}
```

### Via Webpack

**.webpack.config.js**

```javascript
  ...
  rules: [
    {
      test: /\.m?js$/,
      exclude: /node_modules/,
      use: {
        loader: 'babel-loader',
        options: {
          presets: ['@babel/preset-env'],
          plugins: [
            ['babel-plugin-transform-strip-block', { requireDirective: true, identifiers: [{ start: 'block:start', end: 'block:end' }] }]
          ]
        }
      }
    }
  ]
  ...
```

### Example

In:
```javascript
// @strip-block

const foo = {
  /* block:start */
  bar: 'baz',
  /* block:end */
}
```

Out:
```javascript
const foo = {}
```

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