NativeWind brings Tailwind CSS utility classes to React Native, enabling rapid, consistent styling. With Re.Pack, you can seamlessly integrate NativeWind through a dedicated plugin.
@callstack/repack-plugin-nativewind is a plugin for Re.Pack that enables integrating NativeWind into your React Native projects.
This plugin seamlessly integrates NativeWind with Re.Pack's build process by:
First, follow these steps from the official NativeWind installation guide:
Then install the Re.Pack NativeWind plugin and its dependencies:
Note: These additional dependencies (
postcss
,postcss-loader
, andautoprefixer
) 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.
Note: If you are using Webpack (not Rspack), you need to add the following configuration to your babel.config.js
:
To add the plugin to your Re.Pack configuration, update your rspack.config.js
or webpack.config.js
as follows:
postcss.config.js
is set up.