@antscorp/vite-stylex
v0.6.0
Published
Shared StyleX and React Compiler pipeline for consumers' views.
Keywords
Readme
@antscorp/vite-stylex
Shared StyleX extraction and React Compiler pipeline for Vite >=8 source consumers. Requires Node >=24.
bun add -d @antscorp/vite-styleximport { stylex } from "@antscorp/vite-stylex";
import { defaultClientConditions, defineConfig } from "vite";
export default defineConfig({
resolve: { conditions: ["antscorp-source", ...defaultClientConditions] },
plugins: stylex({
dev: false,
sources: [`${import.meta.dirname}/src`],
classNamePrefix: "app",
reactCompiler: true,
}),
});Include the real paths of linked/published UI source directories in sources too, including
paths under node_modules, and put @stylex; in an imported CSS entry. Set parallel: true for
builds to transform in up to four worker threads; leave it off for the dev server and Vitest. This
Node build tool always uses dist/ JavaScript and declarations, even with antscorp-source
enabled. See the repository README.
Extraction always skips tests. A library building its shipped sheet sets excludeStories: true
to leave out *.stories.tsx and the root story.tsx gallery; apps, docs and Storybook keep them.
