weapp-tailwindcss 4.10.1 → 4.10.3
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/dist/{chunk-IIDSY4XZ.js → chunk-6Z4GEN2Y.js} +2 -2
- package/dist/{chunk-7K3R5LV6.js → chunk-DEIJXHGJ.js} +252 -70
- package/dist/{chunk-RXM5ERRJ.mjs → chunk-E7775SFS.mjs} +212 -30
- package/dist/{chunk-RB7YN5XZ.js → chunk-GCRL3ZYP.js} +5 -5
- package/dist/{chunk-W3EZEDKD.js → chunk-L7OBNTRI.js} +8 -7
- package/dist/{chunk-4QCL7FBX.mjs → chunk-LICQ6EGN.mjs} +1 -1
- package/dist/{chunk-ESIT2XWD.mjs → chunk-PALDKVKG.mjs} +58 -5
- package/dist/{chunk-7ZI6WVIU.mjs → chunk-RM3SY4S4.mjs} +3 -2
- package/dist/{chunk-5APD2MNV.js → chunk-RYC23C3K.js} +4 -4
- package/dist/{chunk-HT76VHOV.mjs → chunk-TNYEOBAC.mjs} +1 -1
- package/dist/{chunk-GKT5AE7D.mjs → chunk-UYTCZXNE.mjs} +1 -1
- package/dist/{chunk-K7CTHHN2.js → chunk-W2N6G2QQ.js} +35 -34
- package/dist/{chunk-P65O2L27.js → chunk-WF636Q5E.js} +5 -5
- package/dist/{chunk-3BKE5AJQ.mjs → chunk-WXT2GI5R.mjs} +5 -4
- package/dist/{chunk-EE4DYM4E.js → chunk-YJSFFRNZ.js} +81 -28
- package/dist/{chunk-DBAAU4LK.js → chunk-YUTKX7JZ.js} +1 -1
- package/dist/cli.js +39 -39
- package/dist/cli.mjs +2 -2
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +24 -11
- package/dist/core.mjs +18 -5
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +4 -4
- package/dist/{index-BESv5MWf.d.ts → index-t_VBjwYm.d.mts} +11 -0
- package/dist/{index-BESv5MWf.d.mts → index-t_VBjwYm.d.ts} +11 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/index.mjs +7 -7
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +5 -5
- package/dist/presets.mjs +1 -1
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.d.mts +14 -2
- package/dist/types.d.ts +14 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +4 -4
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +36 -35
- package/dist/webpack4.mjs +5 -4
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-WXT2GI5R.mjs";
|
|
5
|
+
import "./chunk-UYTCZXNE.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createPlugins
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RM3SY4S4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
UnifiedViteWeappTailwindcssPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PALDKVKG.mjs";
|
|
12
12
|
import "./chunk-F2CKKG6Q.mjs";
|
|
13
13
|
import "./chunk-RRHPTTCP.mjs";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-LICQ6EGN.mjs";
|
|
15
|
+
import "./chunk-E7775SFS.mjs";
|
|
16
16
|
import "./chunk-QOTLDKI4.mjs";
|
|
17
17
|
import "./chunk-3WUHHFLF.mjs";
|
|
18
18
|
import "./chunk-OOHJLO5M.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-TNYEOBAC.mjs";
|
|
20
20
|
export {
|
|
21
21
|
UnifiedViteWeappTailwindcssPlugin,
|
|
22
22
|
UnifiedWebpackPluginV5,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-YUTKX7JZ.js');
|
|
2
2
|
|
|
3
3
|
// src/postcss-html-transform.ts
|
|
4
4
|
var _htmltransform = require('@weapp-tailwindcss/postcss/html-transform'); var _htmltransform2 = _interopRequireDefault(_htmltransform);
|
package/dist/presets.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
-
import { U as UserDefinedOptions } from './index-
|
|
2
|
+
import { U as UserDefinedOptions } from './index-t_VBjwYm.mjs';
|
|
3
3
|
import '@babel/parser';
|
|
4
4
|
import '@weapp-tailwindcss/postcss';
|
|
5
5
|
import 'tailwindcss-patch';
|
package/dist/presets.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
-
import { U as UserDefinedOptions } from './index-
|
|
2
|
+
import { U as UserDefinedOptions } from './index-t_VBjwYm.js';
|
|
3
3
|
import '@babel/parser';
|
|
4
4
|
import '@weapp-tailwindcss/postcss';
|
|
5
5
|
import 'tailwindcss-patch';
|
package/dist/presets.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkRYC23C3Kjs = require('./chunk-RYC23C3K.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-YUTKX7JZ.js');
|
|
10
10
|
|
|
11
11
|
// src/presets/shared.ts
|
|
12
12
|
function normalizeCssEntries(entries) {
|
|
@@ -24,7 +24,7 @@ function createBasePreset(options = {}) {
|
|
|
24
24
|
rawOptions,
|
|
25
25
|
...userOptions
|
|
26
26
|
} = options;
|
|
27
|
-
const baseDir =
|
|
27
|
+
const baseDir = _chunkRYC23C3Kjs.resolveTailwindcssBasedir.call(void 0, base);
|
|
28
28
|
const normalizedCssEntries = normalizeCssEntries(cssEntries);
|
|
29
29
|
const tailwindConfig = {
|
|
30
30
|
v2: { cwd: baseDir },
|
|
@@ -70,10 +70,10 @@ function uniApp(options = {}) {
|
|
|
70
70
|
// src/presets/uni-app-x.ts
|
|
71
71
|
|
|
72
72
|
function uniAppX(options) {
|
|
73
|
-
|
|
73
|
+
_chunkRYC23C3Kjs.logger.info(`UNI_PLATFORM: ${_process2.default.env.UNI_PLATFORM}`);
|
|
74
74
|
const utsPlatform = _chunkDYLQ6UOIjs.resolveUniUtsPlatform.call(void 0, );
|
|
75
75
|
const uniPlatform = _chunkDYLQ6UOIjs.resolveUniUtsPlatform.call(void 0, _process2.default.env.UNI_PLATFORM);
|
|
76
|
-
|
|
76
|
+
_chunkRYC23C3Kjs.logger.info(`UNI_UTS_PLATFORM: ${_nullishCoalesce(utsPlatform.raw, () => ( "undefined"))}`);
|
|
77
77
|
const isApp = utsPlatform.isApp || uniPlatform.isApp;
|
|
78
78
|
const cssEntries = normalizeCssEntries(options.cssEntries);
|
|
79
79
|
return _chunkDYLQ6UOIjs.defuOverrideArray.call(void 0,
|
package/dist/presets.mjs
CHANGED
package/dist/reset.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-YUTKX7JZ.js');
|
|
2
2
|
|
|
3
3
|
// src/reset/index.ts
|
|
4
4
|
var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
|
package/dist/reset.mjs
CHANGED
package/dist/types.d.mts
CHANGED
|
@@ -4,8 +4,8 @@ export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/po
|
|
|
4
4
|
import { SourceMap } from 'magic-string';
|
|
5
5
|
import { Result, Root, Document } from 'postcss';
|
|
6
6
|
import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
7
|
-
import { I as IArbitraryValues, U as UserDefinedOptions, b as ICustomAttributesEntities, d as ICreateCacheReturnType, A as AppType } from './index-
|
|
8
|
-
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray } from './index-
|
|
7
|
+
import { I as IArbitraryValues, U as UserDefinedOptions, b as ICustomAttributesEntities, d as ICreateCacheReturnType, A as AppType } from './index-t_VBjwYm.mjs';
|
|
8
|
+
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray } from './index-t_VBjwYm.mjs';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'webpack';
|
|
11
11
|
import 'lru-cache';
|
|
@@ -46,6 +46,18 @@ interface IJsHandlerOptions {
|
|
|
46
46
|
* JS 转译统一遵循 `classNameSet` 精确命中策略,仅转换 tailwindcss-patch 提供的类名集合。
|
|
47
47
|
*/
|
|
48
48
|
staleClassNameFallback?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 控制在 classNameSet 异常时的任意值兜底策略。
|
|
51
|
+
*
|
|
52
|
+
* - `false`:关闭兜底。
|
|
53
|
+
* - `true`:在 class 语义上下文中允许任意值兜底。
|
|
54
|
+
* - `'auto'`:仅在 TailwindCSS v4 且 classNameSet 为空时启用。
|
|
55
|
+
*/
|
|
56
|
+
jsArbitraryValueFallback?: boolean | 'auto';
|
|
57
|
+
/**
|
|
58
|
+
* 当前 TailwindCSS 主版本号,用于自动兜底判定。
|
|
59
|
+
*/
|
|
60
|
+
tailwindcssMajorVersion?: number;
|
|
49
61
|
arbitraryValues?: IArbitraryValues;
|
|
50
62
|
jsPreserveClass?: (keyword: string) => boolean | undefined;
|
|
51
63
|
needEscaped?: boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/po
|
|
|
4
4
|
import { SourceMap } from 'magic-string';
|
|
5
5
|
import { Result, Root, Document } from 'postcss';
|
|
6
6
|
import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
7
|
-
import { I as IArbitraryValues, U as UserDefinedOptions, b as ICustomAttributesEntities, d as ICreateCacheReturnType, A as AppType } from './index-
|
|
8
|
-
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray } from './index-
|
|
7
|
+
import { I as IArbitraryValues, U as UserDefinedOptions, b as ICustomAttributesEntities, d as ICreateCacheReturnType, A as AppType } from './index-t_VBjwYm.js';
|
|
8
|
+
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray } from './index-t_VBjwYm.js';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'webpack';
|
|
11
11
|
import 'lru-cache';
|
|
@@ -46,6 +46,18 @@ interface IJsHandlerOptions {
|
|
|
46
46
|
* JS 转译统一遵循 `classNameSet` 精确命中策略,仅转换 tailwindcss-patch 提供的类名集合。
|
|
47
47
|
*/
|
|
48
48
|
staleClassNameFallback?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 控制在 classNameSet 异常时的任意值兜底策略。
|
|
51
|
+
*
|
|
52
|
+
* - `false`:关闭兜底。
|
|
53
|
+
* - `true`:在 class 语义上下文中允许任意值兜底。
|
|
54
|
+
* - `'auto'`:仅在 TailwindCSS v4 且 classNameSet 为空时启用。
|
|
55
|
+
*/
|
|
56
|
+
jsArbitraryValueFallback?: boolean | 'auto';
|
|
57
|
+
/**
|
|
58
|
+
* 当前 TailwindCSS 主版本号,用于自动兜底判定。
|
|
59
|
+
*/
|
|
60
|
+
tailwindcssMajorVersion?: number;
|
|
49
61
|
arbitraryValues?: IArbitraryValues;
|
|
50
62
|
jsPreserveClass?: (keyword: string) => boolean | undefined;
|
|
51
63
|
needEscaped?: boolean;
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('./chunk-
|
|
1
|
+
"use strict";require('./chunk-YUTKX7JZ.js');
|
package/dist/types.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-TNYEOBAC.mjs";
|
package/dist/vite.d.mts
CHANGED
package/dist/vite.d.ts
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkYJSFFRNZjs = require('./chunk-YJSFFRNZ.js');
|
|
4
|
+
require('./chunk-6Z4GEN2Y.js');
|
|
5
5
|
require('./chunk-LTJQUORK.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-GCRL3ZYP.js');
|
|
7
|
+
require('./chunk-DEIJXHGJ.js');
|
|
8
|
+
require('./chunk-RYC23C3K.js');
|
|
9
9
|
require('./chunk-5U24PLVV.js');
|
|
10
10
|
require('./chunk-DYLQ6UOI.js');
|
|
11
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-YUTKX7JZ.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkYJSFFRNZjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PALDKVKG.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-RRHPTTCP.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-LICQ6EGN.mjs";
|
|
7
|
+
import "./chunk-E7775SFS.mjs";
|
|
8
8
|
import "./chunk-QOTLDKI4.mjs";
|
|
9
9
|
import "./chunk-3WUHHFLF.mjs";
|
|
10
10
|
import "./chunk-OOHJLO5M.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-TNYEOBAC.mjs";
|
|
12
12
|
export {
|
|
13
13
|
UnifiedViteWeappTailwindcssPlugin
|
|
14
14
|
};
|
package/dist/webpack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.mjs';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-t_VBjwYm.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-t_VBjwYm.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunkW2N6G2QQjs = require('./chunk-W2N6G2QQ.js');
|
|
5
|
+
require('./chunk-WF636Q5E.js');
|
|
6
|
+
require('./chunk-6Z4GEN2Y.js');
|
|
7
7
|
require('./chunk-LTJQUORK.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-GCRL3ZYP.js');
|
|
9
|
+
require('./chunk-DEIJXHGJ.js');
|
|
10
|
+
require('./chunk-RYC23C3K.js');
|
|
11
11
|
require('./chunk-5U24PLVV.js');
|
|
12
12
|
require('./chunk-DYLQ6UOI.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-YUTKX7JZ.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunkW2N6G2QQjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkW2N6G2QQjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-WXT2GI5R.mjs";
|
|
5
|
+
import "./chunk-UYTCZXNE.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-LICQ6EGN.mjs";
|
|
9
|
+
import "./chunk-E7775SFS.mjs";
|
|
10
10
|
import "./chunk-QOTLDKI4.mjs";
|
|
11
11
|
import "./chunk-3WUHHFLF.mjs";
|
|
12
12
|
import "./chunk-OOHJLO5M.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-TNYEOBAC.mjs";
|
|
14
14
|
export {
|
|
15
15
|
UnifiedWebpackPluginV5,
|
|
16
16
|
weappTailwindcssPackageDir
|
package/dist/webpack4.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack4';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.mjs';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-t_VBjwYm.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack4.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Compiler } from 'webpack4';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-t_VBjwYm.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack4.js
CHANGED
|
@@ -10,33 +10,33 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkWF636Q5Ejs = require('./chunk-WF636Q5E.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk6Z4GEN2Yjs = require('./chunk-6Z4GEN2Y.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkGCRL3ZYPjs = require('./chunk-GCRL3ZYP.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
34
|
-
require('./chunk-
|
|
33
|
+
var _chunkDEIJXHGJjs = require('./chunk-DEIJXHGJ.js');
|
|
34
|
+
require('./chunk-RYC23C3K.js');
|
|
35
35
|
require('./chunk-5U24PLVV.js');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
39
|
-
require('./chunk-
|
|
39
|
+
require('./chunk-YUTKX7JZ.js');
|
|
40
40
|
|
|
41
41
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
42
42
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -59,7 +59,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
59
59
|
runtimeState,
|
|
60
60
|
debug: debug2
|
|
61
61
|
} = options;
|
|
62
|
-
compiler.hooks.emit.tapPromise(
|
|
62
|
+
compiler.hooks.emit.tapPromise(_chunkDEIJXHGJjs.pluginName, async (compilation) => {
|
|
63
63
|
await runtimeState.patchPromise;
|
|
64
64
|
compilerOptions.onStart();
|
|
65
65
|
debug2("start");
|
|
@@ -68,20 +68,20 @@ function setupWebpackV4EmitHook(options) {
|
|
|
68
68
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const assetHashByChunk =
|
|
71
|
+
const assetHashByChunk = _chunkWF636Q5Ejs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
72
72
|
const assets = compilation.assets;
|
|
73
73
|
const entries = Object.entries(assets);
|
|
74
74
|
const outputDir = _optionalChain([compiler, 'access', _ => _.options, 'optionalAccess', _2 => _2.output, 'optionalAccess', _3 => _3.path]) ? _path2.default.resolve(compiler.options.output.path) : _process2.default.cwd();
|
|
75
75
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
76
76
|
for (const [file] of entries) {
|
|
77
77
|
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
78
|
-
const absolute =
|
|
78
|
+
const absolute = _chunk6Z4GEN2Yjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
79
79
|
jsAssets.set(absolute, file);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
const moduleGraphOptions = {
|
|
83
83
|
resolve(specifier, importer) {
|
|
84
|
-
return
|
|
84
|
+
return _chunk6Z4GEN2Yjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
85
85
|
},
|
|
86
86
|
load: (id) => {
|
|
87
87
|
const assetName = jsAssets.get(id);
|
|
@@ -125,7 +125,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
125
125
|
};
|
|
126
126
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
127
127
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
128
|
-
const runtimeSet = await
|
|
128
|
+
const runtimeSet = await _chunkDEIJXHGJjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
129
129
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
130
130
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
131
131
|
forceCollect: true,
|
|
@@ -170,14 +170,14 @@ function setupWebpackV4EmitHook(options) {
|
|
|
170
170
|
const jsTaskFactories = [];
|
|
171
171
|
if (Array.isArray(groupedEntries.js)) {
|
|
172
172
|
for (const [file] of groupedEntries.js) {
|
|
173
|
-
const cacheKey =
|
|
173
|
+
const cacheKey = _chunkWF636Q5Ejs.getCacheKey.call(void 0, file);
|
|
174
174
|
const assetSource = compilation.assets[file];
|
|
175
175
|
if (!assetSource) {
|
|
176
176
|
continue;
|
|
177
177
|
}
|
|
178
178
|
const initialValue = assetSource.source();
|
|
179
179
|
const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
|
|
180
|
-
const absoluteFile =
|
|
180
|
+
const absoluteFile = _chunk6Z4GEN2Yjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
181
181
|
const chunkHash = assetHashByChunk.get(file);
|
|
182
182
|
jsTaskFactories.push(async () => {
|
|
183
183
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
@@ -198,6 +198,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
198
198
|
const currentSource = typeof currentValue === "string" ? currentValue : _nullishCoalesce(_optionalChain([currentValue, 'optionalAccess', _6 => _6.toString, 'call', _7 => _7()]), () => ( ""));
|
|
199
199
|
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, {
|
|
200
200
|
staleClassNameFallback,
|
|
201
|
+
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
201
202
|
filename: absoluteFile,
|
|
202
203
|
moduleGraph: moduleGraphOptions,
|
|
203
204
|
babelParserOptions: {
|
|
@@ -257,7 +258,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
257
258
|
);
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
|
-
|
|
261
|
+
_chunk6Z4GEN2Yjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
261
262
|
await Promise.all(tasks);
|
|
262
263
|
debug2("end");
|
|
263
264
|
compilerOptions.onEnd();
|
|
@@ -280,9 +281,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
280
281
|
getClassSetInLoader,
|
|
281
282
|
debug: debug2
|
|
282
283
|
} = options;
|
|
283
|
-
const isMpxApp =
|
|
284
|
+
const isMpxApp = _chunkWF636Q5Ejs.isMpx.call(void 0, appType);
|
|
284
285
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
285
|
-
|
|
286
|
+
_chunkWF636Q5Ejs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
286
287
|
}
|
|
287
288
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
288
289
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -295,12 +296,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
295
296
|
const classSetLoaderOptions = {
|
|
296
297
|
getClassSet: getClassSetInLoader
|
|
297
298
|
};
|
|
298
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
299
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkWF636Q5Ejs.createLoaderAnchorFinders.call(void 0, appType);
|
|
299
300
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
300
301
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
301
302
|
} : void 0;
|
|
302
303
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
303
|
-
|
|
304
|
+
_chunkWF636Q5Ejs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
304
305
|
}
|
|
305
306
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
306
307
|
loader: runtimeClassSetLoader,
|
|
@@ -319,19 +320,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
319
320
|
type: null
|
|
320
321
|
};
|
|
321
322
|
};
|
|
322
|
-
compiler.hooks.compilation.tap(
|
|
323
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
323
|
+
compiler.hooks.compilation.tap(_chunkDEIJXHGJjs.pluginName, (compilation) => {
|
|
324
|
+
compilation.hooks.normalModuleLoader.tap(_chunkDEIJXHGJjs.pluginName, (_loaderContext, module) => {
|
|
324
325
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
325
326
|
if (!hasRuntimeLoader) {
|
|
326
327
|
return;
|
|
327
328
|
}
|
|
328
|
-
if (shouldRewriteCssImports &&
|
|
329
|
-
|
|
329
|
+
if (shouldRewriteCssImports && _chunkWF636Q5Ejs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
330
|
+
_chunkWF636Q5Ejs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
330
331
|
}
|
|
331
332
|
const loaderEntries = module.loaders || [];
|
|
332
333
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
333
334
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
334
|
-
const isCssModule =
|
|
335
|
+
const isCssModule = _chunkWF636Q5Ejs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
335
336
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
336
337
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
337
338
|
}
|
|
@@ -365,7 +366,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
365
366
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
|
-
if (runtimeClassSetLoaderExists && !
|
|
369
|
+
if (runtimeClassSetLoaderExists && !_chunkWF636Q5Ejs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
369
370
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
370
371
|
if (anchorIndex === -1) {
|
|
371
372
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -379,11 +380,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
379
380
|
}
|
|
380
381
|
|
|
381
382
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
382
|
-
var debug =
|
|
383
|
-
var weappTailwindcssPackageDir =
|
|
383
|
+
var debug = _chunkDEIJXHGJjs.createDebug.call(void 0, );
|
|
384
|
+
var weappTailwindcssPackageDir = _chunk6Z4GEN2Yjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
384
385
|
var UnifiedWebpackPluginV4 = class {
|
|
385
386
|
constructor(options = {}) {
|
|
386
|
-
this.options =
|
|
387
|
+
this.options = _chunkDEIJXHGJjs.getCompilerContext.call(void 0, options);
|
|
387
388
|
this.appType = this.options.appType;
|
|
388
389
|
}
|
|
389
390
|
apply(compiler) {
|
|
@@ -396,22 +397,22 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
396
397
|
twPatcher: initialTwPatcher,
|
|
397
398
|
refreshTailwindcssPatcher
|
|
398
399
|
} = this.options;
|
|
399
|
-
const disabledOptions =
|
|
400
|
+
const disabledOptions = _chunk6Z4GEN2Yjs.resolveDisabledOptions.call(void 0, disabled);
|
|
400
401
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
401
402
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
402
|
-
const isMpxApp =
|
|
403
|
+
const isMpxApp = _chunkWF636Q5Ejs.isMpx.call(void 0, this.appType);
|
|
403
404
|
if (shouldRewriteCssImports) {
|
|
404
|
-
|
|
405
|
+
_chunkWF636Q5Ejs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
405
406
|
pkgDir: weappTailwindcssPackageDir,
|
|
406
407
|
enabled: true,
|
|
407
408
|
appType: this.appType
|
|
408
409
|
});
|
|
409
|
-
|
|
410
|
+
_chunkWF636Q5Ejs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
410
411
|
}
|
|
411
412
|
if (disabledOptions.plugin) {
|
|
412
413
|
return;
|
|
413
414
|
}
|
|
414
|
-
const patchRecorderState =
|
|
415
|
+
const patchRecorderState = _chunkGCRL3ZYPjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
415
416
|
source: "runtime",
|
|
416
417
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
417
418
|
});
|
|
@@ -423,17 +424,17 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
423
424
|
};
|
|
424
425
|
let runtimeSetPrepared = false;
|
|
425
426
|
let runtimeSetSignature;
|
|
426
|
-
compiler.hooks.compilation.tap(
|
|
427
|
+
compiler.hooks.compilation.tap(_chunkDEIJXHGJjs.pluginName, () => {
|
|
427
428
|
runtimeSetPrepared = false;
|
|
428
429
|
});
|
|
429
430
|
async function getClassSetInLoader() {
|
|
430
431
|
if (runtimeSetPrepared) {
|
|
431
432
|
return;
|
|
432
433
|
}
|
|
433
|
-
const signature =
|
|
434
|
+
const signature = _chunkDEIJXHGJjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
434
435
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
435
436
|
runtimeSetPrepared = true;
|
|
436
|
-
await
|
|
437
|
+
await _chunkDEIJXHGJjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
437
438
|
forceRefresh,
|
|
438
439
|
forceCollect: true,
|
|
439
440
|
clearCache: forceRefresh,
|
package/dist/webpack4.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isMpx,
|
|
11
11
|
patchMpxLoaderResolve,
|
|
12
12
|
setupMpxTailwindcssRedirect
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UYTCZXNE.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
} from "./chunk-RRHPTTCP.mjs";
|
|
24
24
|
import {
|
|
25
25
|
setupPatchRecorder
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LICQ6EGN.mjs";
|
|
27
27
|
import {
|
|
28
28
|
createDebug,
|
|
29
29
|
ensureRuntimeClassSet,
|
|
30
30
|
getCompilerContext,
|
|
31
31
|
getRuntimeClassSetSignature,
|
|
32
32
|
pluginName
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-E7775SFS.mjs";
|
|
34
34
|
import "./chunk-QOTLDKI4.mjs";
|
|
35
35
|
import "./chunk-3WUHHFLF.mjs";
|
|
36
36
|
import {
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-OOHJLO5M.mjs";
|
|
39
39
|
import {
|
|
40
40
|
__dirname
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TNYEOBAC.mjs";
|
|
42
42
|
|
|
43
43
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
44
44
|
import process3 from "process";
|
|
@@ -200,6 +200,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
200
200
|
const currentSource = typeof currentValue === "string" ? currentValue : currentValue?.toString() ?? "";
|
|
201
201
|
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, {
|
|
202
202
|
staleClassNameFallback,
|
|
203
|
+
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
203
204
|
filename: absoluteFile,
|
|
204
205
|
moduleGraph: moduleGraphOptions,
|
|
205
206
|
babelParserOptions: {
|