
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
unplugin-swc
Advanced tools
SWC plugin for Vite and Rollup.
npm i unplugin-swc @swc/core -D
Vite or Rollup:
import swc from 'unplugin-swc'
export default {
plugins: [
// Vite plugin
swc.vite(),
// Rollup plugin
swc.rollup(),
],
}
tsconfig.jsonFollowing SWC options are inferred from tsconfig.json:
jsc.parser.syntax: based on file extensionjsc.parser.jsx, parser.tsx: compilerOptions.jsxjsc.parser.decorators: compilerOptions.experimentalDecoratorsjsc.transform.react.pragma: compilerOptions.jsxFactoryjsc.transform.react.pragmaFrag: compilerOptions.jsxFragmentFactoryjsc.transform.react.importSource: compilerOptions.jsxImportSourcejsc.transform.legacyDecorator: compilerOptions.experimentalDecoratorsjsc.transform.decoratorMetadata: compilerOptions.emitDecoratorMetadatajsc.keepClassNames: when decorator is enabled, because original class name is required by libs like type-graphql to generate correct graphql typeIf you wish to disable this behavior and use .swcrc to control above jsc options, you can use tsconfigFile option:
// Or swc.rollup
swc.vite({
tsconfigFile: false,
})
// It's also possible to use a custom tsconfig file instead of tsconfig.json
swc.vite({
tsconfigFile: './tsconfig.build.json',
})
Use the minify: true option, it only works for Rollup as Vite uses esbuild to minify the code and cannot be changed.
To have advanced control over the minification process, use jsc.minify option in .swcrc.
esbuild will be automatically disabled if you use this plugin.
This plugin accepts all @swc/core options, except for jsc which should be configured in .swcrc instead, and some extra options that are specific to this plugin:
options.tsconfigFileboolean, stringtsconfig.jsonDisable the use of tsconfig file or specify a custom one.
options.includeRegExp/\.[jt]sx?$/Files to include in the transpilation process.
options.excludeRegExp/node_modules/Files to exclude in the transpilation process.
options.jscobjectCustom jsc options to merge with the default one.
MIT © EGOIST
FAQs
SWC plugin for Vite and Rollup
The npm package unplugin-swc receives a total of 623,437 weekly downloads. As such, unplugin-swc popularity was classified as popular.
We found that unplugin-swc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.