@umijs/plugins 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tailwindcss.js +24 -12
  2. package/package.json +4 -4
@@ -18,18 +18,30 @@ exports.default = (api) => {
18
18
  const inputPath = (0, path_1.join)(api.cwd, 'tailwind.css');
19
19
  const generatedPath = (0, path_1.join)(api.paths.absTmpPath, outputPath);
20
20
  const binPath = (0, path_1.join)(api.cwd, 'node_modules/.bin/tailwind');
21
- /** 透过子进程建立 tailwindcss 服务,将生成的 css 写入 generatedPath */
22
- tailwind = (0, plugin_utils_1.crossSpawn)(`${binPath}`, [
23
- '-i',
24
- inputPath,
25
- '-o',
26
- generatedPath,
27
- api.env === 'development' ? '--watch' : '',
28
- ], {
29
- stdio: 'inherit',
30
- });
31
- tailwind.on('error', (m) => {
32
- api.logger.error('tailwindcss service encounter an error: ' + m);
21
+ return new Promise((resolve) => {
22
+ /** 透过子进程建立 tailwindcss 服务,将生成的 css 写入 generatedPath */
23
+ tailwind = (0, plugin_utils_1.crossSpawn)(`${binPath}`, [
24
+ '-i',
25
+ inputPath,
26
+ '-o',
27
+ generatedPath,
28
+ api.env === 'development' ? '--watch' : '',
29
+ ], {
30
+ stdio: 'inherit',
31
+ });
32
+ tailwind.on('error', (m) => {
33
+ api.logger.error('tailwindcss service encounter an error: ' + m);
34
+ });
35
+ if (api.env === 'production') {
36
+ tailwind.on('exit', () => {
37
+ api.logger.info('tailwindcss service exited');
38
+ resolve();
39
+ });
40
+ }
41
+ else {
42
+ api.logger.info('tailwindcss service started');
43
+ resolve();
44
+ }
33
45
  });
34
46
  });
35
47
  /** 将生成的 css 文件加入到 import 中 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "@umijs/plugins",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/plugins#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -18,14 +18,14 @@
18
18
  "scripts": {
19
19
  "build": "pnpm tsc",
20
20
  "build:deps": "umi-scripts bundleDeps",
21
- "dev": "pnpm build -- --watch",
21
+ "dev": "pnpm build --watch",
22
22
  "test": "umi-scripts jest-turbo"
23
23
  },
24
24
  "dependencies": {
25
25
  "@ahooksjs/use-request": "^2.0.0",
26
26
  "@ant-design/icons": "^4.7.0",
27
27
  "@ant-design/pro-layout": "^7.0.1-beta.20",
28
- "@umijs/bundler-utils": "4.0.1",
28
+ "@umijs/bundler-utils": "4.0.2",
29
29
  "antd-dayjs-webpack-plugin": "^1.0.6",
30
30
  "axios": "^0.27.2",
31
31
  "babel-plugin-import": "^1.13.5",
@@ -44,7 +44,7 @@
44
44
  "warning": "^4.0.3"
45
45
  },
46
46
  "devDependencies": {
47
- "umi": "4.0.1"
47
+ "umi": "4.0.2"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"