-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
I'm trying to use @zerollup/ts-transform-paths for a React Native project. RN uses platform extensions such as .ios.tsx,.android.tsx,.native.tsx,.web.tsx to specify platform specific implementations of modules.
TS does not do a great job with these, so the solution is to do something like this with paths in your tsconfig.json
"paths": {
"*": [
"*.android",
"*/index.android",
"*.ios",
"*/index.ios",
"*.native",
"*/index.native",
"*.web",
"*/index.web",
"*"
]
},ref: microsoft/TypeScript#21926
Lets say I have a web and a native version of a component App.native.tsx and App.web.tsx, if import like this
import App from "App"and build with TS, it emits
import App from "./App.native"which makes me sad.
This would make me happy...
import App from "./App"Is this possible?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels