Skip to content

swc-project/swcify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swcify Build Status

SWC browserify transform. Enables ES6/JSX/react for browserify times faster than babelify.

Installation

$ npm install --save-dev swcify @swc/core

Usage

CLI

$ browserify script.js -t swcify > bundle.js

By default, swcify reads .swcrc file in the basedir with SWC config.

Node

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:

{
  "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 option:

browserify({debug: true}).transform("swcify");
$ browserify -d -t swcify

About

Browserify transform for SWC

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%