Releases: HorusGoul/vite-plugin-stylex
[email protected]
[email protected]
Minor Changes
- 378f5c5: Support StyleX 0.7.0
[email protected]
Minor Changes
-
7c43a01: Refactor Plugin to delegate more work to Vite itself
- Use Vite's CSS pipeline for all CSS processing
- Use Vite's
waitForRequestsIdle
experimental API to wait before generating the StyleX StyleSheet - Move to use
renderChunk
hook to generate the StyleX StyleSheet during builds.
This change should make the plugin more robust and easier to maintain in the future.
BREAKING CHANGES
- The plugin now requires Vite 5.2.7 or higher
- There's no more implicit CSS processing, you need to include the
@stylex stylesheet;
rule in a CSS file to generate the StyleX StyleSheet
To migrate, add the
@stylex stylesheet;
rule to a CSS file in your project. Import that CSS file in your entrypoint./* stylex.css */ @stylex stylesheet; ...
// main.ts import './stylex.css'; ...
Patch Changes
[email protected]
Patch Changes
- 9a969ac: Fix alias path on Windows to be '@/' or '@src/' instead of '@\' or '@src\'. Thanks to @DarkAng3L for the PR!
[email protected]
[email protected]
Patch Changes
- 46c32cd: ?url import fix for Remix
[email protected]
Minor Changes
-
41bc4f9: Apply Vite CSS processing and post-processing
This enables minification and other optimizations for CSS files.
[email protected]
Minor Changes
-
36291b7: Add support for react-strict-dom. Fixes #50.
importSources
We're exposing theimportSources
option to allow you to configure alternative import sources forstylex
, likereact-strict-dom
.By default, we include
@stylexjs/stylex
as import source. If you want to usecss
fromreact-strict-dom
, you can configure it like this: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 oflibraries
for you, so you don't have to worry about it.Deprecations:
stylexImports
option is deprecated. UseimportSources
instead (you should be able to just replacestylexImports
withimportSources
in your config).