broccoli-swc

0.2.2 • Public • Published

broccoli-swc

Build Status

Experimental SWC compiler for broccoli (mostly using this to explore SWC, and see what it still needs to be an option for us).

Super-fast javascript to javascript compiler written in rust

TL;DR SWC is a alternative to babel / buble for the JS ecosystem.

This module aims to experiment using SWC in the broccoli and ember-cli ecosystems.

usage

Basic via Brocfile.js or Broccoli pipeline

// Brocfile.js
const swc = require('broccoli-swc');
module.exports = swc(__dirname + '/src', {
  swc: {
    module: {
      type: 'commonjs' | 'amd'
      moduleId: // optional or true, if true it will infer the module name from the file path.
    }
  }
}); // where src/**/*.js contains ecmascript

Extension / Subclassing

// Brocfile.js
const swc = require('broccoli-swc');
 
module.exports = class CustomSWC extends swc.Plugin {
  // custom behavior
}

SWC Issues:

https://github.com/stefanpenner/broccoli-swc/issues/9

Readme

Keywords

Package Sidebar

Install

npm i broccoli-swc

Weekly Downloads

11

Version

0.2.2

License

MIT

Unpacked Size

128 kB

Total Files

6

Last publish

Collaborators

  • stefanpenner
  • mikrostew