Skip to content

Commit

Permalink
changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
HorusGoul committed Mar 21, 2024
1 parent 1158a92 commit 7ba6806
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .changeset/tall-penguins-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
"vite-plugin-stylex": minor
---

Add support for react-strict-dom. Fixes #51.

**`importSources`**
We're exposing the `importSources` option to allow you to configure alternative import sources for `stylex`, like `react-strict-dom`.

By default, we include `@stylexjs/stylex` as import source. If you want to use `css` from `react-strict-dom`, you can configure it like this:

```ts
import { defineConfig } from "vite";
import styleX from "vite-plugin-stylex";

export default defineConfig({
plugins: [
styleX({
importSources: [{ from: "react-strict-dom", as: "css" }],
}),
],
});
```

Also, if we detect that you're using `react-strict-dom`, we'll automatically add it to the list of `libraries` for you, so you don't have to worry about it.

**Deprecations:**

- `stylexImports` option is deprecated. Use `importSources` instead (you should be able to just replace `stylexImports` with `importSources` in your config).
2 changes: 1 addition & 1 deletion packages/vite-plugin-stylex/src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface StyleXVitePluginOptions
>
> {
/**
* @deprecated Use `importSources` instead.
* @deprecated Use `importSources` instead. You should be able to just replace `stylexImports` with `importSources` in your config.
*/
stylexImports?: string[];
/**
Expand Down

0 comments on commit 7ba6806

Please sign in to comment.