@umijs/plugins 4.6.42 → 4.6.43

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.
@@ -42,7 +42,7 @@ var tailwindcss_default = (api) => {
42
42
  api.onBeforeCompiler(() => {
43
43
  const inputPath = (0, import_path.join)(api.cwd, "tailwind.css");
44
44
  const generatedPath = (0, import_path.join)(api.paths.absTmpPath, outputPath);
45
- const binPath = getTailwindBinPath({ cwd: api.cwd });
45
+ const binPath = getTailwindBinPath({ cwd: api.cwd }, api);
46
46
  const configPath = (0, import_path.join)(api.cwd, "tailwind.config.js");
47
47
  if (process.env.IS_UMI_BUILD_WORKER) {
48
48
  return;
@@ -97,10 +97,25 @@ var tailwindcss_default = (api) => {
97
97
  return [{ source: generatedPath }];
98
98
  });
99
99
  };
100
- function getTailwindBinPath(opts) {
100
+ function getTailwindBinPath(opts, api) {
101
101
  const pkgPath = require.resolve("tailwindcss/package.json", {
102
102
  paths: [opts.cwd]
103
103
  });
104
+ const tailwind = require(pkgPath);
105
+ if (tailwind.version.startsWith("4")) {
106
+ try {
107
+ const tailwindCliPath = require.resolve("@tailwindcss/cli/package.json", {
108
+ paths: [opts.cwd]
109
+ });
110
+ const tailwindPath2 = require(tailwindCliPath).bin["tailwindcss"];
111
+ return (0, import_path.join)((0, import_path.dirname)(tailwindCliPath), tailwindPath2);
112
+ } catch {
113
+ api.logger.error(
114
+ "tailwindcss v4 requires @tailwindcss/cli to be installed"
115
+ );
116
+ process.exit(1);
117
+ }
118
+ }
104
119
  const tailwindPath = require(pkgPath).bin["tailwind"];
105
120
  return (0, import_path.join)((0, import_path.dirname)(pkgPath), tailwindPath);
106
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.6.42",
3
+ "version": "4.6.43",
4
4
  "description": "@umijs/plugins",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/plugins#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -45,12 +45,12 @@
45
45
  "styled-components": "6.1.1",
46
46
  "tslib": "^2",
47
47
  "warning": "^4.0.3",
48
- "@umijs/bundler-utils": "4.6.42",
48
+ "@umijs/bundler-utils": "4.6.43",
49
49
  "@umijs/valtio": "1.0.4"
50
50
  },
51
51
  "devDependencies": {
52
52
  "antd": "^4.24.1",
53
- "umi": "4.6.42"
53
+ "umi": "4.6.43"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"