Skip to content

leonardssh/aelbore-rollup-plugin-swc

 
 

Repository files navigation

Logo

NPM version NPM downloads

Rollup plugin to compile bundles with the SWC.

Report Bug · Request Feature · What Is SWC?


Remember to 🌟 this Github if you 💖 it.

📦 Installation

  • Using yarn: yarn add -D @leonardssh/rollup-plugin-swc @swc/core
  • Using npm: npm i --save-dev @leonardssh/rollup-plugin-swc @swc/core
  • Using pnpm: pnpm add -D @leonardssh/rollup-plugin-swc @swc/core

🤓 Usage

// rollup.config.js

import { swcPlugin } from '@leonardssh/rollup-plugin-swc';

export default {
	input: 'index.ts',
	output: {
		dir: 'dist',
		format: 'es'
	},
	plugins: [
		swcPlugin({
			jsc: {
				parser: {
					syntax: 'typescript'
				},
				target: 'es2018'
			}
		})
	]
};

🛠️ Options

The plugin takes all the SWC options except the filename.

👨‍💻 Contributing

To contribute to this repository, feel free to create a new fork of the repository and submit a pull request.

  1. Fork / Clone and select the main branch.
  2. Create a new branch in your fork.
  3. Make your changes.
  4. Commit your changes, and push them.
  5. Submit a Pull Request here!

📋 License

This project is licensed under the MIT License - see the LICENSE file for details.