# @mathewsfpereira/swcify

> SWC browserify transform

Latest version **1.0.2** (published 2023-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mathewsfpereira/swcify
pnpm add @mathewsfpereira/swcify
yarn add @mathewsfpereira/swcify
bun add @mathewsfpereira/swcify
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-07-26 |
| First published | 2023-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.9.0 |
| Dependencies | 2 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Dmitry Yvanov |
| Maintainers | mathewsfpereira |

## Links

- npm: https://www.npmjs.com/package/@mathewsfpereira/swcify
- Repository: https://github.com/swc-project/swcify
- Issues: https://github.com/swc-project/swcify/issues
- npm.io page: https://npm.io/package/@mathewsfpereira/swcify

## Dependencies (2)

- [source-map-to-comment](https://npm.io/package/source-map-to-comment.md) ^1.1.0
- [inline-source-map-comment](https://npm.io/package/inline-source-map-comment.md) ^1.0.5

## Recent versions

- 1.0.2 (latest) — 2023-07-26

## README

# swcify [![Build Status](https://travis-ci.org/dy/swcify.svg?branch=master)](https://travis-ci.org/dy/swcify)

[SWC](https://github.com/swc-project/swc) [browserify](https://github.com/substack/node-browserify) transform. Enables ES6/JSX/react for browserify times faster than babelify.

## Installation

```sh
$ npm install --save-dev swcify @swc/core
```

## Usage

### CLI

```sh
$ browserify script.js -t swcify > bundle.js
```

By default, swcify reads `.swcrc` file in the basedir with SWC config.

### Node

```javascript
var fs = require("fs")
var browserify = require("browserify")

var b = browserify("./script.js")
  .transform("swcify", config)
  .bundle()
  .pipe(fs.createWriteStream("bundle.js"));
```

The optional argument `config` can be an object with options for SWC.


## FAQ

### Why aren't files in `node_modules` being transformed?

This is the default browserify behavior.

A possible solution is to add:

```json
{
  "browserify": {
    "transform": ["swcify"]
  }
}
```

to the root of all your modules `package.json` that you want to be transformed.


### Why am I not getting source maps?

To use source maps, enable them in browserify with the [`debug`](https://github.com/substack/node-browserify#browserifyfiles--opts) option:

```js
browserify({debug: true}).transform("swcify");
```

```sh
$ browserify -d -t swcify
```

---
_Source: https://npm.io/package/@mathewsfpereira/swcify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
