File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ toc: content
10
10
11
11
使用微生成器一键开启 Tailwind CSS 插件
12
12
13
-
14
13
Max 项目
15
14
16
15
``` bash
@@ -34,3 +33,12 @@ info - Write tailwind.css
34
33
```
35
34
36
35
至此就可以在项目中使用 Tailwind CSS 的样式;项目根目录的 ` tailwind.config.js ` 和 ` tailwind.css ` 根据需要修改配置。
36
+
37
+ ## Env
38
+
39
+ 在项目根目录添加 ` .env ` 文件,添加 ` CHECK_TIMEOUT ` 变量,用于设置 Tailwind CSS 插件的检查间隔时间。
40
+
41
+ ``` bash
42
+ # Default: 5
43
+ CHECK_TIMEOUT=10
44
+ ```
Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ import { IApi } from 'umi';
4
4
import { crossSpawn , winPath } from 'umi/plugin-utils' ;
5
5
6
6
const CHECK_INTERVAL = 300 ;
7
- const CHECK_TIMEOUT_UNIT_SECOND = 5 ;
7
+ const CHECK_TIMEOUT = process . env . CHECK_TIMEOUT
8
+ ? parseInt ( process . env . CHECK_TIMEOUT , 10 )
9
+ : 5 ;
8
10
9
11
export default ( api : IApi ) => {
10
12
api . describe ( {
@@ -70,11 +72,11 @@ export default (api: IApi) => {
70
72
if ( ! existsSync ( generatedPath ) ) {
71
73
clearInterval ( timer ) ;
72
74
api . logger . error (
73
- `tailwindcss generate failed after ${ CHECK_TIMEOUT_UNIT_SECOND } seconds, please check your tailwind.css and tailwind.config.js` ,
75
+ `tailwindcss generate failed after ${ CHECK_TIMEOUT } seconds, please check your tailwind.css and tailwind.config.js` ,
74
76
) ;
75
77
process . exit ( 1 ) ;
76
78
}
77
- } , CHECK_TIMEOUT_UNIT_SECOND * 1000 ) ;
79
+ } , CHECK_TIMEOUT * 1000 ) ;
78
80
}
79
81
} ) ;
80
82
} ) ;
You can’t perform that action at this time.
0 commit comments