Skip to content

Commit

Permalink
chore: release v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Apr 11, 2024
1 parent 82a2a23 commit 5e87a5f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.5.1

# Patches

- Fix option `manuallyControlCssOrder` typo.

## 0.5.0

# Features

- Add `manuallyControlCssOrder` option

# Patches

- Fix development mode can't pass css with vite internal handle.

## 0.4.1

# Patches
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-stylex-dev",
"version": "0.5.0",
"version": "0.5.1",
"description": "an unofficial stylex vite plugin",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
12 changes: 7 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function stylexPlugin(opts: StylexPluginOptions = {}): Plugin {
include = /\.(mjs|js|ts|vue|jsx|tsx)(\?.*|)$/,
exclude,
optimizedDeps = [],
manullayControlCssOrder = false,
manuallyControlCssOrder = false,
...options
} = opts
const filter = createFilter(include, exclude)
Expand Down Expand Up @@ -197,7 +197,7 @@ export function stylexPlugin(opts: StylexPluginOptions = {}): Plugin {
viteCSSPlugins.push(...conf.plugins.filter(p => VITE_INTERNAL_CSS_PLUGIN_NAMES.includes(p.name)))
viteCSSPlugins.sort((a, b) => a.name === 'vite:css' && b.name === 'vite:css-post' ? -1 : 1)
patchAlias = createPatchAlias({ parse, importSources })
// hijack vite:css set the meta data for dev
// hijack vite:css set the meta data for dev
if (!isProd && viteCSSPlugins[0]) {
hijackTransformHook(viteCSSPlugins[0], async (id) => {
const { original } = parseURLRequest(id)
Expand All @@ -220,12 +220,14 @@ export function stylexPlugin(opts: StylexPluginOptions = {}): Plugin {
}
})
}
if (typeof manullayControlCssOrder === 'boolean' && manullayControlCssOrder) {

if (typeof manuallyControlCssOrder === 'boolean' && manuallyControlCssOrder) {
Object.assign(controlCSSByManually, defaultControlCSSOptions)
}
if (typeof manullayControlCssOrder === 'object') {
Object.assign(controlCSSByManually, defaultControlCSSOptions, manullayControlCssOrder)
if (typeof manuallyControlCssOrder === 'object') {
Object.assign(controlCSSByManually, defaultControlCSSOptions, manuallyControlCssOrder)
}

if (controlCSSByManually?.id) {
isManuallyCSS = true
controlCSSByManually.id = path.isAbsolute(controlCSSByManually.id)
Expand Down

0 comments on commit 5e87a5f

Please sign in to comment.