weapp-tailwindcss 4.10.1 → 4.10.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.
- package/dist/{chunk-EE4DYM4E.js → chunk-3R7FDZJL.js} +27 -17
- package/dist/{chunk-K7CTHHN2.js → chunk-6VKE7EWV.js} +28 -27
- package/dist/{chunk-GKT5AE7D.mjs → chunk-ACNOEKQI.mjs} +1 -1
- package/dist/{chunk-4QCL7FBX.mjs → chunk-BZCCVPSU.mjs} +1 -1
- package/dist/{chunk-P65O2L27.js → chunk-HJVZ4TO3.js} +3 -3
- package/dist/{chunk-7K3R5LV6.js → chunk-I35XJD75.js} +235 -63
- package/dist/{chunk-3BKE5AJQ.mjs → chunk-LHBUALTK.mjs} +4 -3
- package/dist/{chunk-RB7YN5XZ.js → chunk-M2ATX5ZS.js} +3 -3
- package/dist/{chunk-RXM5ERRJ.mjs → chunk-MPVAZKRB.mjs} +201 -29
- package/dist/{chunk-7ZI6WVIU.mjs → chunk-N6JOG5K3.mjs} +3 -2
- package/dist/{chunk-W3EZEDKD.js → chunk-NPZ5QQC7.js} +8 -7
- package/dist/{chunk-ESIT2XWD.mjs → chunk-WJU62RPV.mjs} +13 -3
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +22 -9
- package/dist/core.mjs +17 -4
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- 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 +7 -7
- package/dist/index.mjs +6 -6
- package/dist/presets.d.mts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/types.d.mts +14 -2
- package/dist/types.d.ts +14 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +27 -26
- package/dist/webpack4.mjs +4 -3
- package/package.json +4 -4
package/dist/core.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setupPatchRecorder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BZCCVPSU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ensureRuntimeClassSet,
|
|
6
6
|
getCompilerContext
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MPVAZKRB.mjs";
|
|
8
8
|
import "./chunk-QOTLDKI4.mjs";
|
|
9
9
|
import "./chunk-3WUHHFLF.mjs";
|
|
10
10
|
import "./chunk-OOHJLO5M.mjs";
|
|
@@ -27,6 +27,19 @@ function createContext(options = {}) {
|
|
|
27
27
|
refreshTailwindcssPatcher,
|
|
28
28
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
29
29
|
};
|
|
30
|
+
function withRuntimeTailwindMajorVersion(options2) {
|
|
31
|
+
const resolvedOptions = {
|
|
32
|
+
...options2 ?? {}
|
|
33
|
+
};
|
|
34
|
+
if (typeof resolvedOptions.tailwindcssMajorVersion === "number") {
|
|
35
|
+
return resolvedOptions;
|
|
36
|
+
}
|
|
37
|
+
const majorVersion = runtimeState.twPatcher.majorVersion;
|
|
38
|
+
if (typeof majorVersion === "number") {
|
|
39
|
+
resolvedOptions.tailwindcssMajorVersion = majorVersion;
|
|
40
|
+
}
|
|
41
|
+
return resolvedOptions;
|
|
42
|
+
}
|
|
30
43
|
async function transformWxss(rawCss, options2) {
|
|
31
44
|
await runtimeState.patchPromise;
|
|
32
45
|
const result = await styleHandler(rawCss, defuOverrideArray(options2, {
|
|
@@ -47,7 +60,7 @@ function createContext(options = {}) {
|
|
|
47
60
|
forceCollect: true
|
|
48
61
|
});
|
|
49
62
|
}
|
|
50
|
-
return await jsHandler(rawJs, runtimeSet, options2);
|
|
63
|
+
return await jsHandler(rawJs, runtimeSet, withRuntimeTailwindMajorVersion(options2));
|
|
51
64
|
}
|
|
52
65
|
async function transformWxml(rawWxml, options2) {
|
|
53
66
|
await runtimeState.patchPromise;
|
|
@@ -60,7 +73,7 @@ function createContext(options = {}) {
|
|
|
60
73
|
return templateHandler(rawWxml, defuOverrideArray(options2, {
|
|
61
74
|
runtimeSet,
|
|
62
75
|
jsHandler: (source, runtime, handlerOptions) => {
|
|
63
|
-
return runtimeJsHandler(source, runtime, handlerOptions);
|
|
76
|
+
return runtimeJsHandler(source, runtime, withRuntimeTailwindMajorVersion(handlerOptions));
|
|
64
77
|
}
|
|
65
78
|
}));
|
|
66
79
|
}
|
package/dist/defaults.d.mts
CHANGED
package/dist/defaults.d.ts
CHANGED
package/dist/gulp.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITemplateHandlerOptions, CreateJsHandlerOptions } from './types.mjs';
|
|
2
2
|
import stream from 'node:stream';
|
|
3
|
-
import { U as UserDefinedOptions } from './index-
|
|
3
|
+
import { U as UserDefinedOptions } from './index-t_VBjwYm.mjs';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|
package/dist/gulp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITemplateHandlerOptions, CreateJsHandlerOptions } from './types.js';
|
|
2
2
|
import stream from 'node:stream';
|
|
3
|
-
import { U as UserDefinedOptions } from './index-
|
|
3
|
+
import { U as UserDefinedOptions } from './index-t_VBjwYm.js';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|
package/dist/gulp.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNPZ5QQC7js = require('./chunk-NPZ5QQC7.js');
|
|
4
4
|
require('./chunk-LTJQUORK.js');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-M2ATX5ZS.js');
|
|
6
|
+
require('./chunk-I35XJD75.js');
|
|
7
7
|
require('./chunk-5APD2MNV.js');
|
|
8
8
|
require('./chunk-5U24PLVV.js');
|
|
9
9
|
require('./chunk-DYLQ6UOI.js');
|
|
10
10
|
require('./chunk-DBAAU4LK.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createPlugins =
|
|
13
|
+
exports.createPlugins = _chunkNPZ5QQC7js.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N6JOG5K3.mjs";
|
|
4
4
|
import "./chunk-RRHPTTCP.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-BZCCVPSU.mjs";
|
|
6
|
+
import "./chunk-MPVAZKRB.mjs";
|
|
7
7
|
import "./chunk-QOTLDKI4.mjs";
|
|
8
8
|
import "./chunk-3WUHHFLF.mjs";
|
|
9
9
|
import "./chunk-OOHJLO5M.mjs";
|
|
@@ -130,6 +130,17 @@ interface UserDefinedOptionsGeneralPart {
|
|
|
130
130
|
* JS 转译统一采用 `classNameSet` 精确匹配策略,仅转换 tailwindcss-patch 提供的类名集合。
|
|
131
131
|
*/
|
|
132
132
|
staleClassNameFallback?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 控制 JS 任意值类名在 classNameSet 异常时的受控兜底策略。
|
|
135
|
+
*
|
|
136
|
+
* @group 3.一般配置
|
|
137
|
+
* @remarks
|
|
138
|
+
* 为避免误伤业务字符串,兜底仅在 class 语义上下文生效。
|
|
139
|
+
* - `false`:关闭兜底;
|
|
140
|
+
* - `true`:始终开启受控兜底;
|
|
141
|
+
* - `'auto'`:仅 TailwindCSS v4 且 classNameSet 为空时启用。
|
|
142
|
+
*/
|
|
143
|
+
jsArbitraryValueFallback?: boolean | 'auto';
|
|
133
144
|
/**
|
|
134
145
|
* 是否替换运行时依赖包名。
|
|
135
146
|
*
|
|
@@ -130,6 +130,17 @@ interface UserDefinedOptionsGeneralPart {
|
|
|
130
130
|
* JS 转译统一采用 `classNameSet` 精确匹配策略,仅转换 tailwindcss-patch 提供的类名集合。
|
|
131
131
|
*/
|
|
132
132
|
staleClassNameFallback?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 控制 JS 任意值类名在 classNameSet 异常时的受控兜底策略。
|
|
135
|
+
*
|
|
136
|
+
* @group 3.一般配置
|
|
137
|
+
* @remarks
|
|
138
|
+
* 为避免误伤业务字符串,兜底仅在 class 语义上下文生效。
|
|
139
|
+
* - `false`:关闭兜底;
|
|
140
|
+
* - `true`:始终开启受控兜底;
|
|
141
|
+
* - `'auto'`:仅 TailwindCSS v4 且 classNameSet 为空时启用。
|
|
142
|
+
*/
|
|
143
|
+
jsArbitraryValueFallback?: boolean | 'auto';
|
|
133
144
|
/**
|
|
134
145
|
* 是否替换运行时依赖包名。
|
|
135
146
|
*
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ export { createPlugins } from './gulp.mjs';
|
|
|
2
2
|
export { CreateJsHandlerOptions, IBaseWebpackPlugin, ICommonReplaceOptions, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike } from './types.mjs';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.mjs';
|
|
4
4
|
export { UnifiedWebpackPluginV5, weappTailwindcssPackageDir } from './webpack.mjs';
|
|
5
|
-
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UserDefinedOptions } from './index-
|
|
5
|
+
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UserDefinedOptions } from './index-t_VBjwYm.mjs';
|
|
6
6
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
7
7
|
import 'node:stream';
|
|
8
8
|
import '@babel/parser';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { createPlugins } from './gulp.js';
|
|
|
2
2
|
export { CreateJsHandlerOptions, IBaseWebpackPlugin, ICommonReplaceOptions, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike } from './types.js';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.js';
|
|
4
4
|
export { UnifiedWebpackPluginV5, weappTailwindcssPackageDir } from './webpack.js';
|
|
5
|
-
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UserDefinedOptions } from './index-
|
|
5
|
+
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UserDefinedOptions } from './index-t_VBjwYm.js';
|
|
6
6
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
7
7
|
import 'node:stream';
|
|
8
8
|
import '@babel/parser';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk6VKE7EWVjs = require('./chunk-6VKE7EWV.js');
|
|
5
|
+
require('./chunk-HJVZ4TO3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkNPZ5QQC7js = require('./chunk-NPZ5QQC7.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk3R7FDZJLjs = require('./chunk-3R7FDZJL.js');
|
|
12
12
|
require('./chunk-IIDSY4XZ.js');
|
|
13
13
|
require('./chunk-LTJQUORK.js');
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-M2ATX5ZS.js');
|
|
15
|
+
require('./chunk-I35XJD75.js');
|
|
16
16
|
require('./chunk-5APD2MNV.js');
|
|
17
17
|
require('./chunk-5U24PLVV.js');
|
|
18
18
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -22,4 +22,4 @@ require('./chunk-DBAAU4LK.js');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
25
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunk3R7FDZJLjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunk6VKE7EWVjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkNPZ5QQC7js.createPlugins; exports.weappTailwindcssPackageDir = _chunk6VKE7EWVjs.weappTailwindcssPackageDir;
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-LHBUALTK.mjs";
|
|
5
|
+
import "./chunk-ACNOEKQI.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createPlugins
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-N6JOG5K3.mjs";
|
|
9
9
|
import {
|
|
10
10
|
UnifiedViteWeappTailwindcssPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WJU62RPV.mjs";
|
|
12
12
|
import "./chunk-F2CKKG6Q.mjs";
|
|
13
13
|
import "./chunk-RRHPTTCP.mjs";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-BZCCVPSU.mjs";
|
|
15
|
+
import "./chunk-MPVAZKRB.mjs";
|
|
16
16
|
import "./chunk-QOTLDKI4.mjs";
|
|
17
17
|
import "./chunk-3WUHHFLF.mjs";
|
|
18
18
|
import "./chunk-OOHJLO5M.mjs";
|
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/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/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
|
|
3
|
+
var _chunk3R7FDZJLjs = require('./chunk-3R7FDZJL.js');
|
|
4
4
|
require('./chunk-IIDSY4XZ.js');
|
|
5
5
|
require('./chunk-LTJQUORK.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-M2ATX5ZS.js');
|
|
7
|
+
require('./chunk-I35XJD75.js');
|
|
8
8
|
require('./chunk-5APD2MNV.js');
|
|
9
9
|
require('./chunk-5U24PLVV.js');
|
|
10
10
|
require('./chunk-DYLQ6UOI.js');
|
|
11
11
|
require('./chunk-DBAAU4LK.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunk3R7FDZJLjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WJU62RPV.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-RRHPTTCP.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-BZCCVPSU.mjs";
|
|
7
|
+
import "./chunk-MPVAZKRB.mjs";
|
|
8
8
|
import "./chunk-QOTLDKI4.mjs";
|
|
9
9
|
import "./chunk-3WUHHFLF.mjs";
|
|
10
10
|
import "./chunk-OOHJLO5M.mjs";
|
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,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk6VKE7EWVjs = require('./chunk-6VKE7EWV.js');
|
|
5
|
+
require('./chunk-HJVZ4TO3.js');
|
|
6
6
|
require('./chunk-IIDSY4XZ.js');
|
|
7
7
|
require('./chunk-LTJQUORK.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-M2ATX5ZS.js');
|
|
9
|
+
require('./chunk-I35XJD75.js');
|
|
10
10
|
require('./chunk-5APD2MNV.js');
|
|
11
11
|
require('./chunk-5U24PLVV.js');
|
|
12
12
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-DBAAU4LK.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunk6VKE7EWVjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunk6VKE7EWVjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-LHBUALTK.mjs";
|
|
5
|
+
import "./chunk-ACNOEKQI.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BZCCVPSU.mjs";
|
|
9
|
+
import "./chunk-MPVAZKRB.mjs";
|
|
10
10
|
import "./chunk-QOTLDKI4.mjs";
|
|
11
11
|
import "./chunk-3WUHHFLF.mjs";
|
|
12
12
|
import "./chunk-OOHJLO5M.mjs";
|
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,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkHJVZ4TO3js = require('./chunk-HJVZ4TO3.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -23,14 +23,14 @@ var _chunkIIDSY4XZjs = require('./chunk-IIDSY4XZ.js');
|
|
|
23
23
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkM2ATX5ZSjs = require('./chunk-M2ATX5ZS.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkI35XJD75js = require('./chunk-I35XJD75.js');
|
|
34
34
|
require('./chunk-5APD2MNV.js');
|
|
35
35
|
require('./chunk-5U24PLVV.js');
|
|
36
36
|
|
|
@@ -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(_chunkI35XJD75js.pluginName, async (compilation) => {
|
|
63
63
|
await runtimeState.patchPromise;
|
|
64
64
|
compilerOptions.onStart();
|
|
65
65
|
debug2("start");
|
|
@@ -68,7 +68,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
68
68
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const assetHashByChunk =
|
|
71
|
+
const assetHashByChunk = _chunkHJVZ4TO3js.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();
|
|
@@ -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 _chunkI35XJD75js.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
129
129
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
130
130
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
131
131
|
forceCollect: true,
|
|
@@ -170,7 +170,7 @@ 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 = _chunkHJVZ4TO3js.getCacheKey.call(void 0, file);
|
|
174
174
|
const assetSource = compilation.assets[file];
|
|
175
175
|
if (!assetSource) {
|
|
176
176
|
continue;
|
|
@@ -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: {
|
|
@@ -280,9 +281,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
280
281
|
getClassSetInLoader,
|
|
281
282
|
debug: debug2
|
|
282
283
|
} = options;
|
|
283
|
-
const isMpxApp =
|
|
284
|
+
const isMpxApp = _chunkHJVZ4TO3js.isMpx.call(void 0, appType);
|
|
284
285
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
285
|
-
|
|
286
|
+
_chunkHJVZ4TO3js.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 } = _chunkHJVZ4TO3js.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
|
+
_chunkHJVZ4TO3js.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(_chunkI35XJD75js.pluginName, (compilation) => {
|
|
324
|
+
compilation.hooks.normalModuleLoader.tap(_chunkI35XJD75js.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 && _chunkHJVZ4TO3js.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
330
|
+
_chunkHJVZ4TO3js.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 = _chunkHJVZ4TO3js.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 && !_chunkHJVZ4TO3js.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 debug = _chunkI35XJD75js.createDebug.call(void 0, );
|
|
383
384
|
var weappTailwindcssPackageDir = _chunkIIDSY4XZjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
384
385
|
var UnifiedWebpackPluginV4 = class {
|
|
385
386
|
constructor(options = {}) {
|
|
386
|
-
this.options =
|
|
387
|
+
this.options = _chunkI35XJD75js.getCompilerContext.call(void 0, options);
|
|
387
388
|
this.appType = this.options.appType;
|
|
388
389
|
}
|
|
389
390
|
apply(compiler) {
|
|
@@ -399,19 +400,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
399
400
|
const disabledOptions = _chunkIIDSY4XZjs.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 = _chunkHJVZ4TO3js.isMpx.call(void 0, this.appType);
|
|
403
404
|
if (shouldRewriteCssImports) {
|
|
404
|
-
|
|
405
|
+
_chunkHJVZ4TO3js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
405
406
|
pkgDir: weappTailwindcssPackageDir,
|
|
406
407
|
enabled: true,
|
|
407
408
|
appType: this.appType
|
|
408
409
|
});
|
|
409
|
-
|
|
410
|
+
_chunkHJVZ4TO3js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
410
411
|
}
|
|
411
412
|
if (disabledOptions.plugin) {
|
|
412
413
|
return;
|
|
413
414
|
}
|
|
414
|
-
const patchRecorderState =
|
|
415
|
+
const patchRecorderState = _chunkM2ATX5ZSjs.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(_chunkI35XJD75js.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 = _chunkI35XJD75js.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
434
435
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
435
436
|
runtimeSetPrepared = true;
|
|
436
|
-
await
|
|
437
|
+
await _chunkI35XJD75js.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
437
438
|
forceRefresh,
|
|
438
439
|
forceCollect: true,
|
|
439
440
|
clearCache: forceRefresh,
|