Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mentaljam/rollup-plugin-swc
Rollup plugin to compile bundles with the SWC.
https://github.com/mentaljam/rollup-plugin-swc
plugin rollup swc
Last synced: 12 days ago
JSON representation
Rollup plugin to compile bundles with the SWC.
- Host: GitHub
- URL: https://github.com/mentaljam/rollup-plugin-swc
- Owner: mentaljam
- License: mit
- Archived: true
- Created: 2019-06-03T18:46:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-01T11:37:15.000Z (almost 3 years ago)
- Last Synced: 2024-08-01T19:57:25.678Z (3 months ago)
- Topics: plugin, rollup, swc
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/rollup-plugin-swc
- Size: 68.4 KB
- Stars: 73
- Watchers: 1
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rollup-plugin-swc
[Rollup](https://github.com/rollup/rollup) plugin to compile bundles with the [SWC](https://swc-project.github.io).
## Install
```sh
npm i -D rollup-plugin-swc @swc/core
```
> Note: `@swc/core` is a peer dependency## Usage
```js
// rollup.config.jsimport swc from 'rollup-plugin-swc'
export default {
input: 'index.ts',
output: {
dir: 'dist',
format: 'es',
},
plugins: [
swc({
rollup: {
exclude: 'path/to/exclude/',
},
jsc: {
parser: {
syntax: 'typescript',
},
target: 'es2018',
},
}),
],
}
```## Options
The plugin takes all the [SWC options](https://swc-project.github.io/docs/configuring-swc) except the `filename`.
In addition to the above `SWC Options`, it takes following options for smoother integration with the `rollup` plugin convention:
### `rollup.exclude`
Type: `String` | `Array[...String]`
Default: `null`A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.
### `rollup.include`
Type: `String` | `Array[...String]`
Default: `null`A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.
## License
[MIT](LICENSE) © [Petr Tsymbarovich](mailto:[email protected])