New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

bun-plugin-swc

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-plugin-swc

A Bun plugin for transpiling TypeScript with SWC (Speedy Web Compiler).

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
7
250%
Maintainers
1
Weekly downloads
 
Created
Source

bun-plugin-swc

A Bun plugin for transpiling TypeScript with SWC (Speedy Web Compiler).

Background

As of September 2023, Bun does not support emitDecoratorMetadata, which limits its compatibility with popular libraries such as NestJS. To address this issue, this plugin transpiles TypeScript imports using SWC, then feeds the resulting JavaScript code back into Bun's default JavaScript loader.

Install

bun add --dev bun-plugin-swc

Usage

First, create a preload script to load the plugin:

preload.ts

import { plugin } from 'bun';
import swcPlugin from 'bun-plugin-swc';

void plugin(swcPlugin());

Then, add the preload script to your bunfig.toml:

bunfig.toml

preload = ["./preload.ts"]

[test]
preload = ["./preload.ts"]

For a real world example, see the example project in this repository.

FAQs

Package last updated on 19 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts