diff --git a/packages/jest/README.md b/packages/jest/README.md index 2703e694b..7e07ed7d7 100644 --- a/packages/jest/README.md +++ b/packages/jest/README.md @@ -1,5 +1,25 @@ # @swc/plugin-jest +The SWC implementation of `babel-jest`. This plugin transforms test files using SWC, enabling fast Jest-based testing without Babel. It replaces `babel-jest` as the transformer in Jest configurations and supports TypeScript, JSX, and modern JavaScript features. + +## Usage + +Install the plugin and configure Jest to use SWC as the transformer: + +```sh +npm install --save-dev @swc/plugin-jest @swc/jest @swc/core +``` + +Then update your Jest configuration (e.g. `jest.config.js`): + +```js +module.exports = { + transform: { + "^.+\\.(t|j)sx?$": "@swc/jest", + }, +}; +``` + # @swc/plugin-jest ## 12.7.0 diff --git a/packages/loadable-components/README.md b/packages/loadable-components/README.md index 7bcd77dd9..6aae487f9 100644 --- a/packages/loadable-components/README.md +++ b/packages/loadable-components/README.md @@ -1,5 +1,7 @@ # loadable-components +SWC plugin for [`@loadable/component`](https://loadable-components.com/). It transforms dynamic imports inside loadable functions to add chunk names and enable server-side rendering (SSR) support for code-splitting. This is the SWC equivalent of [`babel-plugin-loadable-components`](https://github.com/gregberge/loadable-components/tree/main/packages/babel-plugin). + ## Config ```json diff --git a/packages/noop/README.md b/packages/noop/README.md index 28788e753..e10a102b0 100644 --- a/packages/noop/README.md +++ b/packages/noop/README.md @@ -1,5 +1,19 @@ # @swc/plugin-noop +A no-operation (noop) SWC plugin that passes the AST through unchanged. Useful for debugging the SWC plugin infrastructure, measuring plugin overhead, or as a minimal starting template for new plugins. + +## Usage + +```json +{ + "jsc": { + "experimental": { + "plugins": [["@swc/plugin-noop", {}]] + } + } +} +``` + # @swc/plugin-noop ## 12.7.0 diff --git a/packages/react-remove-properties/README.md b/packages/react-remove-properties/README.md index 4193c9c2b..c0b34c466 100644 --- a/packages/react-remove-properties/README.md +++ b/packages/react-remove-properties/README.md @@ -1,4 +1,6 @@ -# react-remove-properties +# @swc/plugin-react-remove-properties + +Removes custom React properties (such as `data-testid`) from JSX elements at build time. This reduces bundle size and prevents test-only attributes from being shipped to production. By default it removes all `data-testid` attributes, but you can configure it to target any property using a regex pattern. See https://nextjs.org/docs/architecture/nextjs-compiler#remove-react-properties for more information. diff --git a/packages/relay/README.md b/packages/relay/README.md index 049ab1608..ca3a2ce7e 100644 --- a/packages/relay/README.md +++ b/packages/relay/README.md @@ -1,3 +1,7 @@ +# @swc/plugin-relay + +SWC plugin for [Relay](https://relay.dev/), Facebook's GraphQL client framework for React. It compiles `graphql` tagged template literals into Relay-compatible artifacts, replacing them with `require()` calls to the compiled query files. This is the SWC equivalent of [`babel-plugin-relay`](https://www.npmjs.com/package/babel-plugin-relay). + ### `@swc/plugin-relay` #### Setup diff --git a/packages/remove-console/README.md b/packages/remove-console/README.md index cb22ebcbb..123714ee7 100644 --- a/packages/remove-console/README.md +++ b/packages/remove-console/README.md @@ -1,4 +1,6 @@ -# remove-console +# @swc/plugin-remove-console + +Removes `console.*` calls (e.g. `console.log`, `console.warn`, `console.error`) from JavaScript/TypeScript code at build time. This reduces bundle size and prevents debug output from being included in production builds. Specific console methods can be excluded from removal (e.g. keeping `console.error`). See https://nextjs.org/docs/architecture/nextjs-compiler#remove-console for more information. diff --git a/packages/styled-components/README.md b/packages/styled-components/README.md index 8c502bce0..0ae6d64aa 100644 --- a/packages/styled-components/README.md +++ b/packages/styled-components/README.md @@ -1,3 +1,7 @@ +# @swc/plugin-styled-components + +SWC plugin for [styled-components](https://styled-components.com/), a popular CSS-in-JS library. It adds display names for better debugging, server-side rendering (SSR) support via deterministic class names, and smaller bundles by removing unnecessary code in production. This is the SWC equivalent of [`babel-plugin-styled-components`](https://github.com/styled-components/babel-plugin-styled-components). + ### `@swc/plugin-styled-components` #### Setup diff --git a/packages/styled-jsx/README.md b/packages/styled-jsx/README.md index ab9fd15d5..7a42cc2dc 100644 --- a/packages/styled-jsx/README.md +++ b/packages/styled-jsx/README.md @@ -1,5 +1,23 @@ # @swc/plugin-styled-jsx +SWC plugin for [styled-jsx](https://github.com/vercel/styled-jsx), Vercel's CSS-in-JS solution. It transforms `