Rollup plugin to compile bundles with the SWC.
npm i -D rollup-plugin-swc
// rollup.config.js
import swc from 'rollup-plugin-swc'
export default {
input: 'index.ts',
output: {
dir: 'dist',
format: 'es',
},
plugins: [
swc({
jsc: {
parser: {
syntax: 'typescript',
},
target: 'es2018',
},
}),
],
}
The plugin takes all the SWC options except the filename
.