rollup-plugin-swc3
Advanced tools
Changelog
0.11.2
New feature viteMinify
to use swc's minification in Vite.
import { defineConfig } from 'vite';
import { viteMinify } from 'rollup-plugin-swc3'
export default defineConfig({
plugins: [
viteMinify({
// swc's minify option here
// mangle: {}
// compress: {}
}),
],
})
Changelog
0.10.3
@swc/core
(https://github.com/SukkaW/rollup-plugin-swc/pull/54 by @kdy1)Changelog
0.10.1
rollup-plugin-swc3
now will always provide baseUrl
(resolve to an absolute path) to swc as long as the paths
is specified in the tsconfig.json
or jsconfig.json
being read.Changelog
0.10.0
rollup-plugin-swc3
now will resolve baseUrl
to an absolute path against the tsconfig.json
and jsconfig.json
being read.swc
: https://github.com/swc-project/swc/issues/7799 and https://github.com/swc-project/swc/issues/7800.Changelog
0.9.1
'use client'
and 'use server'
has been separated into a standalone rollup plugin rollup-swc-preserve-directives
, maintained by @huozhi and me. The previous preserveUseDirective
named export is retained for the backward compatibility.Changelog
0.9.0
Add support for bundling library for React Server Component with the proper 'use client'
and 'use server'
directives handling:
rollup.config.js
:// rollup.config.js
// Import `preserveUseDirective` from `rollup-plugin-swc3`...
- import { swc } from 'rollup-plugin-swc3';
+ import { swc, preserveUseDirective } from 'rollup-plugin-swc3';
export default {
input: 'xxxx',
output: {},
plugins: [
swc(),
+ preserveUseDirective()
];
}