@modern-js/plugin-tailwindcss 2.21.1 → 2.22.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @modern-js/plugin-tailwindcss
2
2
 
3
+ ## 2.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5522285: fix(tailwind): should not add tools.babel config when not haveTwinMacro
8
+
9
+ fix(tailwind): 在没有命中 haveTwinMacro 时,不添加 tools.babel 配置
10
+
11
+ - Updated dependencies [e2848a2]
12
+ - Updated dependencies [9b69987]
13
+ - Updated dependencies [d4045ed]
14
+ - @modern-js/runtime@2.22.1
15
+ - @modern-js/utils@2.22.1
16
+
17
+ ## 2.22.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [3d48836]
22
+ - Updated dependencies [63cdea1]
23
+ - Updated dependencies [8f1141c]
24
+ - Updated dependencies [5050e8e]
25
+ - Updated dependencies [dc45896]
26
+ - Updated dependencies [79180c2]
27
+ - Updated dependencies [c271c5d]
28
+ - @modern-js/runtime@2.22.0
29
+ - @modern-js/utils@2.22.0
30
+
3
31
  ## 2.21.1
4
32
 
5
33
  ### Patch Changes
package/dist/cjs/cli.js CHANGED
@@ -10,8 +10,12 @@ function _export(target, all) {
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- getRandomTwConfigFileName: () => getRandomTwConfigFileName,
14
- default: () => _default
13
+ getRandomTwConfigFileName: function() {
14
+ return getRandomTwConfigFileName;
15
+ },
16
+ default: function() {
17
+ return _default;
18
+ }
15
19
  });
16
20
  const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
17
21
  const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
@@ -104,22 +108,20 @@ const _default = ({ pluginName } = {
104
108
  ];
105
109
  }
106
110
  },
107
- babel(_, { addPlugins }) {
108
- if (haveTwinMacro) {
109
- initTailwindConfig();
110
- addPlugins([
111
- [
112
- require.resolve("babel-plugin-macros"),
113
- {
114
- twin: {
115
- preset: supportCssInJsLibrary,
116
- config: internalTwConfigPath || tailwindConfig
117
- }
111
+ babel: haveTwinMacro ? (_, { addPlugins }) => {
112
+ initTailwindConfig();
113
+ addPlugins([
114
+ [
115
+ require.resolve("babel-plugin-macros"),
116
+ {
117
+ twin: {
118
+ preset: supportCssInJsLibrary,
119
+ config: internalTwConfigPath || tailwindConfig
118
120
  }
119
- ]
120
- ]);
121
- }
122
- }
121
+ }
122
+ ]
123
+ ]);
124
+ } : void 0
123
125
  }
124
126
  };
125
127
  },
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: () => _default
7
+ get: function() {
8
+ return _default;
9
+ }
8
10
  });
9
11
  const _utils = require("@modern-js/utils");
10
12
  const _default = ({ pluginName } = {
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: () => _runtime.default
7
+ get: function() {
8
+ return _runtime.default;
9
+ }
8
10
  });
9
11
  const _export_star = require("@swc/helpers/_/_export_star");
10
12
  const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: () => _default
7
+ get: function() {
8
+ return _default;
9
+ }
8
10
  });
9
11
  const _default = ({ cssVarsHash = {} } = {}) => ({
10
12
  postcssPlugin: "postcss-replace-css-vars",
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: () => _default
7
+ get: function() {
8
+ return _default;
9
+ }
8
10
  });
9
11
  const _export_star = require("@swc/helpers/_/_export_star");
10
12
  const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
@@ -10,9 +10,15 @@ function _export(target, all) {
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- DesignTokenContext: () => DesignTokenContext,
14
- useDesignTokens: () => useDesignTokens,
15
- default: () => _default
13
+ DesignTokenContext: function() {
14
+ return DesignTokenContext;
15
+ },
16
+ useDesignTokens: function() {
17
+ return useDesignTokens;
18
+ },
19
+ default: function() {
20
+ return _default;
21
+ }
16
22
  });
17
23
  const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
18
24
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
package/dist/cjs/index.js CHANGED
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: () => _cli.default
7
+ get: function() {
8
+ return _cli.default;
9
+ }
8
10
  });
9
11
  const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
10
12
  const _cli = /* @__PURE__ */ _interop_require_default._(require("./cli"));
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "getTailwindConfig", {
6
6
  enumerable: true,
7
- get: () => getTailwindConfig
7
+ get: function() {
8
+ return getTailwindConfig;
9
+ }
8
10
  });
9
11
  const _utils = require("@modern-js/utils");
10
12
  const _lodash = require("@modern-js/utils/lodash");
package/dist/cjs/utils.js CHANGED
@@ -10,11 +10,21 @@ function _export(target, all) {
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
- template: () => template,
14
- checkTwinMacroExist: () => checkTwinMacroExist,
15
- getTwinMacroMajorVersion: () => getTwinMacroMajorVersion,
16
- getTailwindPath: () => getTailwindPath,
17
- getTailwindVersion: () => getTailwindVersion
13
+ template: function() {
14
+ return template;
15
+ },
16
+ checkTwinMacroExist: function() {
17
+ return checkTwinMacroExist;
18
+ },
19
+ getTwinMacroMajorVersion: function() {
20
+ return getTwinMacroMajorVersion;
21
+ },
22
+ getTailwindPath: function() {
23
+ return getTailwindPath;
24
+ },
25
+ getTailwindVersion: function() {
26
+ return getTailwindVersion;
27
+ }
18
28
  });
19
29
  const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
30
  const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
package/dist/esm/cli.js CHANGED
@@ -103,23 +103,21 @@ export default function() {
103
103
  ];
104
104
  }
105
105
  },
106
- babel: function babel(_, param) {
106
+ babel: haveTwinMacro ? function(_, param) {
107
107
  var addPlugins = param.addPlugins;
108
- if (haveTwinMacro) {
109
- initTailwindConfig();
110
- addPlugins([
111
- [
112
- require.resolve("babel-plugin-macros"),
113
- {
114
- twin: {
115
- preset: supportCssInJsLibrary,
116
- config: internalTwConfigPath || tailwindConfig
117
- }
108
+ initTailwindConfig();
109
+ addPlugins([
110
+ [
111
+ require.resolve("babel-plugin-macros"),
112
+ {
113
+ twin: {
114
+ preset: supportCssInJsLibrary,
115
+ config: internalTwConfigPath || tailwindConfig
118
116
  }
119
- ]
120
- ]);
121
- }
122
- }
117
+ }
118
+ ]
119
+ ]);
120
+ } : void 0
123
121
  }
124
122
  };
125
123
  },
@@ -88,22 +88,20 @@ export default ({ pluginName } = {
88
88
  ];
89
89
  }
90
90
  },
91
- babel(_, { addPlugins }) {
92
- if (haveTwinMacro) {
93
- initTailwindConfig();
94
- addPlugins([
95
- [
96
- require.resolve("babel-plugin-macros"),
97
- {
98
- twin: {
99
- preset: supportCssInJsLibrary,
100
- config: internalTwConfigPath || tailwindConfig
101
- }
91
+ babel: haveTwinMacro ? (_, { addPlugins }) => {
92
+ initTailwindConfig();
93
+ addPlugins([
94
+ [
95
+ require.resolve("babel-plugin-macros"),
96
+ {
97
+ twin: {
98
+ preset: supportCssInJsLibrary,
99
+ config: internalTwConfigPath || tailwindConfig
102
100
  }
103
- ]
104
- ]);
105
- }
106
- }
101
+ }
102
+ ]
103
+ ]);
104
+ } : void 0
107
105
  }
108
106
  };
109
107
  },
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.21.1",
18
+ "version": "2.22.1",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -49,7 +49,7 @@
49
49
  "babel-plugin-macros": "3.1.0",
50
50
  "hoist-non-react-statics": "^3.3.2",
51
51
  "@swc/helpers": "0.5.1",
52
- "@modern-js/utils": "2.21.1"
52
+ "@modern-js/utils": "2.22.1"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/jest": "^29",
@@ -59,17 +59,17 @@
59
59
  "jest": "^29",
60
60
  "react": "^18",
61
61
  "postcss": "8.4.21",
62
- "@modern-js/core": "2.21.1",
63
- "@modern-js/module-tools": "2.21.1",
64
- "@modern-js/runtime": "2.21.1",
65
- "@modern-js/types": "2.21.1",
66
- "@scripts/build": "2.21.1",
67
- "@modern-js/app-tools": "2.21.1",
68
- "@scripts/jest-config": "2.21.1"
62
+ "@modern-js/core": "2.22.1",
63
+ "@modern-js/module-tools": "2.22.1",
64
+ "@modern-js/runtime": "2.22.1",
65
+ "@modern-js/types": "2.22.1",
66
+ "@scripts/build": "2.22.1",
67
+ "@modern-js/app-tools": "2.22.1",
68
+ "@scripts/jest-config": "2.22.1"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "tailwindcss": ">= 2.0.0 || >= 3.0.0",
72
- "@modern-js/runtime": "^2.21.1"
72
+ "@modern-js/runtime": "^2.22.1"
73
73
  },
74
74
  "peerDependenciesMeta": {
75
75
  "@modern-js/runtime": {