A Rollup plugin that integrates swc (Speedy Web Compiler) for fast TypeScript/JavaScript transpilation leveraging ts-swc-transform. Current stable version is 2.4.0, with a maintenance release cadence. Key differentiators: performance-oriented alternative to @rollup/plugin-typescript or @rollup/plugin-babel; supports tsconfig resolution via get-tsconfig; ships TypeScript types; requires Node >=16. Suitable for bundling workflows that prioritize speed over full type-checking.
npm install ts-swc-rollup-pluginVerified import paths — ran on the pinned version, not inferred.
Minimal Rollup config using ts-swc-rollup-plugin to transpile TypeScript entry point, with optional SWC_ENV environment variable.
Update to Node >=16 and use import syntax. For CJS projects, consider dynamic import or use v1.x.
Use getTsconfig() from get-tsconfig package: swc({ tsconfig: getTsconfig() }).Add a separate tsc --noEmit script to your build pipeline.
Create a fresh options object per build configuration.
npm install ts-swc-rollup-plugin --save-dev and ensure tsconfig.json has 'moduleResolution': 'node' or 'node16' (>= v2).
Use import swc from 'ts-swc-rollup-plugin' in an ES module context (type: 'module' in package.json or .mjs extension).
Ensure tsconfig.json exists and is valid JSON. Pass explicit tsconfig path: swc({ tsconfig: 'tsconfig.json' }).