From b0bf58c78ed2fb08817ad151e7b5c28fabd27413 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sat, 8 Jul 2023 15:37:28 +0800 Subject: [PATCH] release: 0.9.0 --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ README.md | 4 +--- package.json | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf9daf..0cc22b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +## 0.9.0 + +- Add support for bundling library for React Server Component with the proper `'use client'` and `'use server'` directives handling: + - Merge duplicated directives in the final bundles + - Multiple output chunks will have their own separated directives, useful when bundling client only code and server only code in different bundles. + - Not enabled by default. manually opt-in by changing two lines of code in your `rollup.config.js`: + + ```diff + // rollup.config.js + // Import `preserveUseDirective` from `rollup-plugin-swc3`... + - import { swc } from 'rollup-plugin-swc3'; + + import { swc, preserveUseDirective } from 'rollup-plugin-swc3'; + + // rollup.config.js + import { swc } from 'rollup-plugin-swc3'; + + export default { + input: 'xxxx', + output: {}, + plugins: [ + swc(), + + preserveUseDirective() + ]; + } + ``` + ## 0.8.2 - Enable CI auto publish release + npm provenance diff --git a/README.md b/README.md index ce9e971..cbe4186 100644 --- a/README.md +++ b/README.md @@ -167,12 +167,10 @@ const swcMinifyConfig = {} Since version `0.9.0`, the support for `'use client'` and `'use server'` has been added: ```js +// rollup.config.js // Import `preserveUseDirective` from `rollup-plugin-swc3`... import { swc, preserveUseDirective } from 'rollup-plugin-swc3'; -// rollup.config.js -import { swc } from 'rollup-plugin-swc3'; - export default { input: 'xxxx', output: {}, diff --git a/package.json b/package.json index 4c4a197..97d4397 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup-plugin-swc3", - "version": "0.8.2", + "version": "0.9.0", "description": "Use SWC with Rollup to transform ESNext and TypeScript code.", "main": "dist/index.js", "module": "dist/index.mjs",