rollup-plugin-swc

Rollup plugin to compile bundles with the SWC.

MIT 7 个版本
安装
npm install rollup-plugin-swc
yarn add rollup-plugin-swc
pnpm add rollup-plugin-swc
bun add rollup-plugin-swc
README

rollup-plugin-swc

Rollup plugin to compile bundles with the SWC.

Install

npm i -D rollup-plugin-swc @swc/core

Note: @swc/core is a peer dependency

Usage

// rollup.config.js

import 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 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, 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, or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

License

MIT © Petr Tsymbarovich

版本列表
0.2.1 2022-02-01
0.2.0 2021-06-30
0.1.4 2020-05-18
0.1.3 2019-12-05
0.1.2 2019-06-06
0.1.1 2019-06-03
0.1.0 2019-06-03