@callstack/repack-plugin-nativewind

中文文档
5.4.3发布于 2026/11/04MITTypeScriptCommonJS构建来源已验证近 30 天下载 5453

A plugin for @callstack/repack that integrates NativeWind

原始使用文档
文档目录6 节
  1. A toolkit to build your React Native application with Rspac…
  2. About
  3. Installation
  4. Usage
  5. Plugin
  6. Made with ❤️ at Callstack
Re.Pack

A toolkit to build your React Native application with Rspack or Webpack.

mit licence npm downloads Chat PRs Welcome

@callstack/repack-plugin-nativewind is a plugin for @callstack/repack that enables integrating NativeWind into your React Native projects.

About

This plugin seamlessly integrates NativeWind with Re.Pack's build process by:

  • Configuring PostCSS and Tailwind CSS processing for your stylesheets
  • Handling conversion of CSS to React Native-compatible styles
  • Setting up proper SWC transformations for NativeWind's JSX runtime

Installation

First, follow these steps from the official NativeWind installation guide:

  1. Install NativeWind
  2. Setup Tailwind CSS
  3. Import your CSS file
  4. (Optional) Setup TypeScript support

Then install the Re.Pack NativeWind plugin and it's dependencies:

npm install -D @callstack/repack-plugin-nativewind postcss postcss-loader autoprefixer

These additional dependencies (postcss, postcss-loader, and autoprefixer) are required for processing Tailwind CSS with Webpack/Rspack, as specified in the official Tailwind CSS Rspack guide. They enable PostCSS processing and autoprefixing of CSS styles in your build pipeline.

Usage

Note: If you are using Webpack (not Rspack), you need to add the following configuration to your babel.config.js:

plugins: [
  [
    '@babel/plugin-transform-react-jsx',
    {
      runtime: 'automatic',
      importSource: 'nativewind',
    },
  ],
],

Plugin

To add the plugin to your Re.Pack configuration, update your rspack.config.js or webpack.config.js as follows:

import { NativeWindPlugin } from "@callstack/repack-plugin-nativewind";

export default (env) => {
  // ...
  return {
    // ...
    plugins: [
      // ...
      new NativeWindPlugin(),
    ],
  };
};

Check out our website at https://re-pack.dev for more info and documentation or our GitHub: https://github.com/callstack/repack.

Made with ❤️ at Callstack

@callstack/repack is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Callstack is a group of React and React Native geeks, contact us at [email protected] if you need any help with these or just want to say hi!

Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥

版本与发布记录

@callstack/repack-plugin-nativewind 共发布 64 个版本,首次发布于 2025/01/20;过去 12 个月发布了 25 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.4.3latest2026/11/044 天前
5.4.3-canary-20261104085523canary2026/11/045 天前
5.4.3-canary-202611031705202026/11/045 天前
5.4.3-canary-202610221720592026/10/2317 天前
5.4.3-canary-202610220910092026/10/2218 天前
5.4.3-canary-202610140001292026/10/1426 天前

其他发布通道:rc → 5.1.0-rc.0,canary → 5.4.3-canary-20261104085523。

关于 @callstack/repack-plugin-nativewind 的常见问题

@callstack/repack-plugin-nativewind 是什么?

A plugin for @callstack/repack that integrates NativeWind

如何安装 @callstack/repack-plugin-nativewind?

在项目目录运行 npm install @callstack/repack-plugin-nativewind,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:postcss(>=8.4.31)、nativewind(>=4.1.23)、tailwindcss(>=3.4.11)、autoprefixer(>=10.4.16)、postcss-loader(>=8.1.1)、@callstack/repack(^5.4.3)、react-native-css-interop(>=0.1.22)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@callstack/repack-plugin-nativewind 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@callstack/repack-plugin-nativewind 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@callstack/repack-plugin-nativewind 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@callstack/repack-plugin-nativewind 可以商用吗?

@callstack/repack-plugin-nativewind 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@callstack/repack-plugin-nativewind 的下载量有多少?

根据 npm 官方下载统计,@callstack/repack-plugin-nativewind 在 2026/10/09 – 2026/11/07 这 30 天内被下载 5,453 次,日均约 182 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@callstack/repack-plugin-nativewind 还在维护吗?

最新版本 5.4.3 发布于 2026/11/04(4 天前);至今共发布 64 个版本,其中过去 12 个月发布了 25 个;首次发布于 2025/01/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。