Skip to content

nonzzz/vite-plugin-stylex

Repository files navigation

vite-plugin-stylex

Warning

This is a development branch for stylex vite plugin. Each feature will be pass in the repo. This is an unofficial repo.

Features

  • SSR
  • automatic injection
  • HMR

Usage

$ yarn add vite-plugin-stylex-dev -D
import { defineConfig } from "vite";
import { stylexPlugin } from "vite-plugin-stylex-dev";

export default defineConfig({
  plugins: [stylexPlugin()],
});

Options

params type default description
include string | RegExp | Array<string | RegExp> /\.(mjs|js|ts|vue|jsx|tsx)(\?.*|)$/ Include all assets matching any of these conditions.
exclude string | RegExp | Array<string | RegExp> - Exclude all assets matching any of these conditions.
importSources string[] ['stylex', '@stylexjs/stylex'] Only assets bigger than this size are processed (in bytes)
babelConfig object {} Babel config for stylex
unstable_moduleResolution Record<string,any> { type: 'commonJS', rootDir: process.cwd() } See stylex document
useCSSLayers boolean default See stylex document
optimizedDeps Array<string> [] Work with external stylex files or libraries
manuallyControlCssOrder boolean |object false control css order by manually

Q & A

Q&A

Author

Kanno

LICENSE

MIT