Skip to content

Commit 05ec1f5

Browse files
authored
fix(plugin-stylus): define option type (#4861)
1 parent 2cfa591 commit 05ec1f5

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

packages/plugin-stylus/src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ export const PLUGIN_STYLUS_NAME = 'rsbuild:stylus';
99

1010
type StylusOptions = {
1111
use?: string[];
12-
define?: [string, any, boolean?];
12+
/**
13+
* Define Stylus variables or functions.
14+
*
15+
* @default {}
16+
* @example
17+
* define: [
18+
* ["$development", process.env.NODE_ENV === "development"],
19+
* ["rawVar", 42, true],
20+
* ]
21+
*/
22+
define?: [string, any, boolean?][];
1323
include?: string[];
1424
/**
1525
* Import the specified Stylus files/paths, can not be relative path.

website/docs/en/plugins/list/plugin-stylus.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ To customize the compilation behavior of Stylus, use the following options.
6767
```ts
6868
type StylusOptions = {
6969
use?: string[];
70-
define?: [string, any, boolean?];
70+
define?: [string, any, boolean?][];
7171
include?: string[];
7272
import?: string[];
7373
resolveURL?: boolean;

website/docs/zh/plugins/list/plugin-stylus.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ console.log(style.title);
6767
```ts
6868
type StylusOptions = {
6969
use?: string[];
70-
define?: [string, any, boolean?];
70+
define?: [string, any, boolean?][];
7171
include?: string[];
7272
import?: string[];
7373
resolveURL?: boolean;

0 commit comments

Comments
 (0)