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.
- SWC Repo: https://github.com/swc-project/swc
- SWC Site: https://swc-project.github.io/
This module aims to experiment using SWC in the broccoli and ember-cli ecosystems.
// Brocfile.js
const swc = require('broccoli-swc');
module.exports = swc(__dirname + '/src', {
namedAmd: true | false, // defaults to false, but if true will wrap the CJS in named AMD output
swc: {/* swc options */ }
}); // where src/**/*.js contains ecmascript
// Brocfile.js
const swc = require('broccoli-swc');
module.exports = class CustomSWC extends swc.Plugin {
// custom behavior
}
swc-project/swc#151 commonjs transformation not working via JS API #151- swc-project/swc#154 add support for "named amd" module targets
- swc-project/swc#104 Something like @babel/preset-env
- swc-project/swc#155 add support for external helpers
- swc-project/swc#18 Plugin system (we often rely on custom build steps such as debug/assert/feature flag stripping)