@callstack/repack-plugin-nativewind
TypeScript icon, indicating that this package has built-in type declarations

5.0.6 • Public • Published
Re.Pack logo

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.

Package Sidebar

Install

npm i @callstack/repack-plugin-nativewind

Weekly Downloads

107

Version

5.0.6

License

MIT

Unpacked Size

16.4 kB

Total Files

13

Last publish

Collaborators

  • souhe
  • thymikee
  • grabbou
  • satya164
  • mdjastrzebski
  • jbinda
  • okwasniewski
  • rafikitiki
  • admin-callstack
  • fabioh_ck
  • jbroma
  • robik
  • piotrski
OSZAR »