Skip to content

Commit 175a60a

Browse files
fix: expose missing NATIVEWIND_OS in NativeWind plugin (#1173)
Co-authored-by: Jakub Romańczyk <lorczyslav@gmail.com>
1 parent 2590cd8 commit 175a60a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.changeset/plugin-nativewind.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@callstack/repack': patch
3+
'@callstack/repack-plugin-nativewind': patch
4+
---
5+
6+
Fix platform detection for NativeWind via `NATIVEWIND_OS` env var

packages/plugin-nativewind/src/plugin.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export class NativeWindPlugin implements RspackPluginInstance {
106106
if (this.options.checkDependencies) {
107107
this.ensureNativewindDependenciesInstalled(compiler.context);
108108
}
109+
/** Set the platform if not present*/
110+
const platformName = compiler.options.name;
111+
if (process.env.NATIVEWIND_OS === undefined) {
112+
process.env.NATIVEWIND_OS = platformName;
113+
}
109114

110115
/**
111116
* First, we need to process the CSS files using PostCSS.

0 commit comments

Comments
 (0)