jpudysz / react-native-unistyles

Level up your React Native StyleSheet

Home Page:https://unistyl.es

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.web files breaks loading from import maps

TheUltDev opened this issue · comments

Description

Unistyles 2.0 does not current load in browsers due to native files loading UnistylesModule.ts and useCSS.ts instead of UnistylesModule.web.ts and useCSS.web.ts.

Normally you could setup esbuild to load those web extensions, but you cannot in the browser. An easy fix is to remove the web extensions to make those the default and use .native to override.

Steps to reproduce

  1. Use Unistyles 2.0 in an import map
  2. Note registry failure and files loaded via network

Snack or a link to a repository (optional)

No response

Unistyles version

2.0.0-rc.1

React Native version

Platforms

React Native Web

Engine

None

Architecture

Paper (old)

Just for context - this is for a custom environment.
Metro and Webpack are working as intended. I will experiment with the .native extension, as it won't make a difference to me and may help you with the project.