vite-plugin-stylex-dev

an unofficial stylex vite plugin

MIT 28 个版本
安装
npm install vite-plugin-stylex-dev
yarn add vite-plugin-stylex-dev
pnpm add vite-plugin-stylex-dev
bun add vite-plugin-stylex-dev
README

vite-plugin-stylex

[!WARNING] This is an unofficial repo. This plugin is dedicated to providing stable stylex integration.

Features

  • CSS automatic injection
  • Support HMR
  • Control css order by manually
  • Support Vite-based SSR framework

Usage

$ yarn add vite-plugin-stylex-dev -D
// vite.config.ts
import { defineConfig } from 'vite'
import { stylex } from 'vite-plugin-stylex-dev'

export default defineConfig({
  plugins: [stylex()]
})

// then find your project entry(If you don't using manuallyControlCssOrder option)
import 'virtual:stylex.css'

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'] See stylex document.
babelConfig object {} Babel config for stylex
unstable_moduleResolution Record<string,any> { type: 'commonJS', rootDir: process.cwd() } See stylex document
useCSSLayers boolean false See stylex document
optimizedDeps Array<string> [] Work with external stylex files or libraries
manuallyControlCssOrder boolean |object false control css order by manually
enableStylexExtend boolean | StylexExtendOptions false see @stylex-extend/babel-plugin docss

Q & A

Q&A

Author

Kanno

LICENSE

MIT

版本列表
0.8.0 2024-06-26
0.7.5 2024-05-17
0.7.4 2024-05-15
0.7.3 2024-05-13
0.7.2 2024-05-06
0.7.1 2024-05-06
0.7.0 2024-04-30
0.6.4 2024-04-29
0.6.3 2024-04-29
0.6.2 2024-04-29
0.6.1 2024-04-27
0.6.0 2024-04-27
0.5.2 2024-04-17
0.5.1 2024-04-11
0.5.0 2024-04-11
0.4.1 2024-03-29
0.4.0 2024-03-19
0.3.0 2024-01-30
0.2.5 2024-01-24
0.2.4 2024-01-15
0.2.3 2024-01-09
0.2.2 2024-01-08
0.2.1 2024-01-07
0.2.0 2024-01-07
0.1.3 2023-12-25
0.1.2 2023-12-20
0.1.1 2023-12-18
0.1.0 2023-12-18