5.1.2 • Published 8 months ago

@callstack/repack-plugin-nativewind v5.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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.

5.1.2

8 months ago

5.1.1

8 months ago

5.1.0

9 months ago

5.1.0-rc.0

9 months ago

5.0.6

10 months ago

5.0.5

10 months ago

5.0.4

11 months ago

5.0.3

11 months ago

5.0.2

11 months ago

5.0.1

11 months ago

5.0.0

11 months ago

5.0.0-rc.12

11 months ago

5.0.0-rc.11

12 months ago

5.0.0-rc.10

1 year ago

5.0.0-rc.9

1 year ago

5.0.0-rc.8

1 year ago

5.0.0-rc.7

1 year ago