facebook / facebook/stylex

Vite example almost done

Open
#1,103 6 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
10.3k
Forks
481
Avg merge
3d 8h
Merged PRs (30d)
13

Description

Based on the [work](https://github.com/sergiocarneiro/example-stylex-vite-packages/tree/main) of @sergiocarneiro, I made a working minimalistic Vite example repo.

https://github.com/hyperknot/bug_repro/tree/main/vite_stylex_react

It works 90% done, except for the `@alias`-ed imports for tokens/vars. I've spent many hours, but cannot figure out how to configure @stylexjs/babel-plugin to support `@alias`-es.

I tried rootDir, rewriteAliases, aliases, etc. but it alway just gives me the same answer:

```
Could not resolve the path to the imported file.
Please ensure that the theme file has a .stylex.js or .stylex.ts extension ...
```

I guess I'd need some official help from someone who knows the stylex babel-plugin inside-out. Could you have a look at my example repo? If this is solved, it could finally become the official Vite example.

![Image](https://github.com/user-attachments/assets/c324446d-55fb-45ce-b9d3-6a8b384944c5)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.