weapp-tailwindcss 4.11.0-alpha.4 → 4.11.0-alpha.6
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-GCZ7ZE7V.js → chunk-4BHL5BDO.js} +31 -31
- package/dist/{chunk-N3RT3VZH.js → chunk-DO6MQ3YF.js} +364 -74
- package/dist/{chunk-JKK5KZCN.js → chunk-KWG7VWW5.js} +3 -3
- package/dist/{chunk-TDHY27WS.mjs → chunk-LYANBRNN.mjs} +1 -1
- package/dist/{chunk-3V52XTPJ.mjs → chunk-OMARW5NC.mjs} +50 -0
- package/dist/{chunk-FI75TLOQ.js → chunk-QK6VNNNL.js} +51 -1
- package/dist/{chunk-NYZTRTBM.mjs → chunk-RQLIVYJZ.mjs} +331 -41
- package/dist/{chunk-ZPGT5C7G.mjs → chunk-TSRWDW6S.mjs} +1 -1
- package/dist/{chunk-JOT24YET.mjs → chunk-VMKFA54Q.mjs} +10 -4
- package/dist/{chunk-VHUV7ZDB.js → chunk-VO5STL3U.js} +6 -6
- package/dist/{chunk-VO2ZPNCW.js → chunk-WPH7LL5V.js} +23 -17
- package/dist/{chunk-6R2OVCLW.mjs → chunk-ZMQZ667Q.mjs} +3 -3
- package/dist/cli.js +2 -1
- package/dist/cli.mjs +2 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +7 -7
- package/dist/core.mjs +2 -2
- 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-BMwzhITq.d.mts → index-D8E0GGqB.d.mts} +28 -2
- package/dist/{index-BMwzhITq.d.ts → index-D8E0GGqB.d.ts} +28 -2
- 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 +36 -1
- package/dist/presets.d.ts +36 -1
- package/dist/presets.js +14 -5
- package/dist/presets.mjs +12 -3
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -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 +26 -26
- package/dist/webpack4.mjs +3 -3
- package/package.json +2 -1
package/dist/presets.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
-
import {
|
|
2
|
+
import { e as UserDefinedOptions, U as UniAppXComponentLocalStylesOptions } from './index-D8E0GGqB.mjs';
|
|
3
3
|
import '@babel/parser';
|
|
4
4
|
import '@weapp-tailwindcss/postcss/types';
|
|
5
5
|
import 'tailwindcss-patch';
|
|
@@ -21,13 +21,48 @@ interface UniAppPresetOptions extends BasePresetOptions {
|
|
|
21
21
|
declare function uniApp(options?: UniAppPresetOptions): Partial<UserDefinedOptions>;
|
|
22
22
|
|
|
23
23
|
interface UniAppXOptions {
|
|
24
|
+
/**
|
|
25
|
+
* uni-app x 工程根目录。
|
|
26
|
+
*/
|
|
24
27
|
base: string;
|
|
28
|
+
/**
|
|
29
|
+
* 指定 Tailwind CSS v4 的入口 CSS。
|
|
30
|
+
*/
|
|
25
31
|
cssEntries?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* rem 转 rpx 配置。
|
|
34
|
+
*/
|
|
26
35
|
rem2rpx?: UserDefinedOptions['rem2rpx'];
|
|
36
|
+
/**
|
|
37
|
+
* 长度单位转 px 配置。
|
|
38
|
+
*/
|
|
27
39
|
unitsToPx?: UserDefinedOptions['unitsToPx'];
|
|
40
|
+
/**
|
|
41
|
+
* 透传原始插件配置。
|
|
42
|
+
*/
|
|
28
43
|
rawOptions?: UserDefinedOptions;
|
|
44
|
+
/**
|
|
45
|
+
* 自定义包解析路径。
|
|
46
|
+
*/
|
|
29
47
|
resolve?: PackageResolvingOptions;
|
|
48
|
+
/**
|
|
49
|
+
* 自定义模板属性转换规则。
|
|
50
|
+
*/
|
|
30
51
|
customAttributes?: UserDefinedOptions['customAttributes'];
|
|
52
|
+
/**
|
|
53
|
+
* 直接控制 `uniAppX.componentLocalStyles` 的快捷入口。
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* 默认开启;默认仅在 `manifest.json` 的 `styleIsolationVersion=2` 时启用。
|
|
57
|
+
*/
|
|
58
|
+
uniAppX?: UserDefinedOptions['uniAppX'];
|
|
59
|
+
/**
|
|
60
|
+
* issue #822 组件局部样式能力的快捷开关。
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* 等价于设置 `uniAppX.componentLocalStyles`。
|
|
64
|
+
*/
|
|
65
|
+
componentLocalStyles?: boolean | UniAppXComponentLocalStylesOptions;
|
|
31
66
|
}
|
|
32
67
|
declare function uniAppX(options: UniAppXOptions): Partial<UserDefinedOptions>;
|
|
33
68
|
|
package/dist/presets.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
-
import {
|
|
2
|
+
import { e as UserDefinedOptions, U as UniAppXComponentLocalStylesOptions } from './index-D8E0GGqB.js';
|
|
3
3
|
import '@babel/parser';
|
|
4
4
|
import '@weapp-tailwindcss/postcss/types';
|
|
5
5
|
import 'tailwindcss-patch';
|
|
@@ -21,13 +21,48 @@ interface UniAppPresetOptions extends BasePresetOptions {
|
|
|
21
21
|
declare function uniApp(options?: UniAppPresetOptions): Partial<UserDefinedOptions>;
|
|
22
22
|
|
|
23
23
|
interface UniAppXOptions {
|
|
24
|
+
/**
|
|
25
|
+
* uni-app x 工程根目录。
|
|
26
|
+
*/
|
|
24
27
|
base: string;
|
|
28
|
+
/**
|
|
29
|
+
* 指定 Tailwind CSS v4 的入口 CSS。
|
|
30
|
+
*/
|
|
25
31
|
cssEntries?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* rem 转 rpx 配置。
|
|
34
|
+
*/
|
|
26
35
|
rem2rpx?: UserDefinedOptions['rem2rpx'];
|
|
36
|
+
/**
|
|
37
|
+
* 长度单位转 px 配置。
|
|
38
|
+
*/
|
|
27
39
|
unitsToPx?: UserDefinedOptions['unitsToPx'];
|
|
40
|
+
/**
|
|
41
|
+
* 透传原始插件配置。
|
|
42
|
+
*/
|
|
28
43
|
rawOptions?: UserDefinedOptions;
|
|
44
|
+
/**
|
|
45
|
+
* 自定义包解析路径。
|
|
46
|
+
*/
|
|
29
47
|
resolve?: PackageResolvingOptions;
|
|
48
|
+
/**
|
|
49
|
+
* 自定义模板属性转换规则。
|
|
50
|
+
*/
|
|
30
51
|
customAttributes?: UserDefinedOptions['customAttributes'];
|
|
52
|
+
/**
|
|
53
|
+
* 直接控制 `uniAppX.componentLocalStyles` 的快捷入口。
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* 默认开启;默认仅在 `manifest.json` 的 `styleIsolationVersion=2` 时启用。
|
|
57
|
+
*/
|
|
58
|
+
uniAppX?: UserDefinedOptions['uniAppX'];
|
|
59
|
+
/**
|
|
60
|
+
* issue #822 组件局部样式能力的快捷开关。
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* 等价于设置 `uniAppX.componentLocalStyles`。
|
|
64
|
+
*/
|
|
65
|
+
componentLocalStyles?: boolean | UniAppXComponentLocalStylesOptions;
|
|
31
66
|
}
|
|
32
67
|
declare function uniAppX(options: UniAppXOptions): Partial<UserDefinedOptions>;
|
|
33
68
|
|
package/dist/presets.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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(); } } 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; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
var _chunkQK6VNNNLjs = require('./chunk-QK6VNNNL.js');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -24,7 +25,7 @@ function createBasePreset(options = {}) {
|
|
|
24
25
|
rawOptions,
|
|
25
26
|
...userOptions
|
|
26
27
|
} = options;
|
|
27
|
-
const baseDir =
|
|
28
|
+
const baseDir = _chunkQK6VNNNLjs.resolveTailwindcssBasedir.call(void 0, base);
|
|
28
29
|
const normalizedCssEntries = normalizeCssEntries(cssEntries);
|
|
29
30
|
const tailwindConfig = {
|
|
30
31
|
v2: { cwd: baseDir },
|
|
@@ -111,18 +112,26 @@ function resolveInstalledTailwindDefaults(resolve) {
|
|
|
111
112
|
return void 0;
|
|
112
113
|
}
|
|
113
114
|
function uniAppX(options) {
|
|
114
|
-
|
|
115
|
+
_chunkQK6VNNNLjs.logger.info(`UNI_PLATFORM: ${_process2.default.env.UNI_PLATFORM}`);
|
|
115
116
|
const utsPlatform = _chunkDYLQ6UOIjs.resolveUniUtsPlatform.call(void 0, );
|
|
116
117
|
const uniPlatform = _chunkDYLQ6UOIjs.resolveUniUtsPlatform.call(void 0, _process2.default.env.UNI_PLATFORM);
|
|
117
|
-
|
|
118
|
+
_chunkQK6VNNNLjs.logger.info(`UNI_UTS_PLATFORM: ${_nullishCoalesce(utsPlatform.raw, () => ( "undefined"))}`);
|
|
118
119
|
const isApp = utsPlatform.isApp || uniPlatform.isApp;
|
|
119
120
|
const cssEntries = normalizeCssEntries(options.cssEntries);
|
|
120
121
|
const resolvedResolve = resolveTailwindResolveOptions(options.base, options.resolve);
|
|
121
122
|
const installedTailwindDefaults = resolveInstalledTailwindDefaults(resolvedResolve);
|
|
123
|
+
const resolvedUniAppX = _chunkQK6VNNNLjs.resolveUniAppXOptions.call(void 0, {
|
|
124
|
+
enabled: isApp,
|
|
125
|
+
componentLocalStyles: _nullishCoalesce(options.componentLocalStyles, () => ( true)),
|
|
126
|
+
...typeof options.uniAppX === "object" ? options.uniAppX : {}
|
|
127
|
+
});
|
|
128
|
+
if (typeof options.uniAppX === "boolean") {
|
|
129
|
+
resolvedUniAppX.enabled = options.uniAppX;
|
|
130
|
+
}
|
|
122
131
|
return _chunkDYLQ6UOIjs.defuOverrideArray.call(void 0,
|
|
123
132
|
_nullishCoalesce(options.rawOptions, () => ( {})),
|
|
124
133
|
{
|
|
125
|
-
uniAppX:
|
|
134
|
+
uniAppX: resolvedUniAppX,
|
|
126
135
|
rem2rpx: options.rem2rpx,
|
|
127
136
|
unitsToPx: options.unitsToPx,
|
|
128
137
|
tailwindcssBasedir: options.base,
|
package/dist/presets.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger,
|
|
3
|
-
resolveTailwindcssBasedir
|
|
4
|
-
|
|
3
|
+
resolveTailwindcssBasedir,
|
|
4
|
+
resolveUniAppXOptions
|
|
5
|
+
} from "./chunk-OMARW5NC.mjs";
|
|
5
6
|
import {
|
|
6
7
|
defuOverrideArray,
|
|
7
8
|
resolveUniUtsPlatform
|
|
@@ -119,10 +120,18 @@ function uniAppX(options) {
|
|
|
119
120
|
const cssEntries = normalizeCssEntries(options.cssEntries);
|
|
120
121
|
const resolvedResolve = resolveTailwindResolveOptions(options.base, options.resolve);
|
|
121
122
|
const installedTailwindDefaults = resolveInstalledTailwindDefaults(resolvedResolve);
|
|
123
|
+
const resolvedUniAppX = resolveUniAppXOptions({
|
|
124
|
+
enabled: isApp,
|
|
125
|
+
componentLocalStyles: options.componentLocalStyles ?? true,
|
|
126
|
+
...typeof options.uniAppX === "object" ? options.uniAppX : {}
|
|
127
|
+
});
|
|
128
|
+
if (typeof options.uniAppX === "boolean") {
|
|
129
|
+
resolvedUniAppX.enabled = options.uniAppX;
|
|
130
|
+
}
|
|
122
131
|
return defuOverrideArray(
|
|
123
132
|
options.rawOptions ?? {},
|
|
124
133
|
{
|
|
125
|
-
uniAppX:
|
|
134
|
+
uniAppX: resolvedUniAppX,
|
|
126
135
|
rem2rpx: options.rem2rpx,
|
|
127
136
|
unitsToPx: options.unitsToPx,
|
|
128
137
|
tailwindcssBasedir: options.base,
|
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,
|
|
8
|
-
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray } from './index-
|
|
7
|
+
import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-D8E0GGqB.mjs';
|
|
8
|
+
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-D8E0GGqB.mjs';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'webpack';
|
|
11
11
|
import 'lru-cache';
|
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,
|
|
8
|
-
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray } from './index-
|
|
7
|
+
import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-D8E0GGqB.js';
|
|
8
|
+
export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-D8E0GGqB.js';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'webpack';
|
|
11
11
|
import 'lru-cache';
|
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 _chunkDO6MQ3YFjs = require('./chunk-DO6MQ3YF.js');
|
|
4
4
|
require('./chunk-7LKMJZD2.js');
|
|
5
5
|
require('./chunk-OF6MFURR.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-WPH7LL5V.js');
|
|
7
|
+
require('./chunk-QK6VNNNL.js');
|
|
8
8
|
require('./chunk-LL3QUKJI.js');
|
|
9
9
|
require('./chunk-DYLQ6UOI.js');
|
|
10
10
|
require('./chunk-CRDOWYG4.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkDO6MQ3YFjs.UnifiedViteWeappTailwindcssPlugin; exports.weappTailwindcss = _chunkDO6MQ3YFjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RQLIVYJZ.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-76S2EME4.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-VMKFA54Q.mjs";
|
|
7
|
+
import "./chunk-OMARW5NC.mjs";
|
|
8
8
|
import "./chunk-23K4XDKF.mjs";
|
|
9
9
|
import "./chunk-OOHJLO5M.mjs";
|
|
10
10
|
import "./chunk-EFBQ4SQR.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,
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-D8E0GGqB.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
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,
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-D8E0GGqB.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
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 _chunk4BHL5BDOjs = require('./chunk-4BHL5BDO.js');
|
|
5
|
+
require('./chunk-KWG7VWW5.js');
|
|
6
6
|
require('./chunk-7LKMJZD2.js');
|
|
7
7
|
require('./chunk-OF6MFURR.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-WPH7LL5V.js');
|
|
9
|
+
require('./chunk-QK6VNNNL.js');
|
|
10
10
|
require('./chunk-LL3QUKJI.js');
|
|
11
11
|
require('./chunk-DYLQ6UOI.js');
|
|
12
12
|
require('./chunk-CRDOWYG4.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunk4BHL5BDOjs.UnifiedWebpackPluginV5; exports.weappTailwindcss = _chunk4BHL5BDOjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunk4BHL5BDOjs.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-ZMQZ667Q.mjs";
|
|
5
|
+
import "./chunk-TSRWDW6S.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-76S2EME4.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-VMKFA54Q.mjs";
|
|
9
|
+
import "./chunk-OMARW5NC.mjs";
|
|
10
10
|
import "./chunk-23K4XDKF.mjs";
|
|
11
11
|
import "./chunk-OOHJLO5M.mjs";
|
|
12
12
|
import "./chunk-EFBQ4SQR.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,
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-D8E0GGqB.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
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,
|
|
3
|
+
import { A as AppType, e as UserDefinedOptions } from './index-D8E0GGqB.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
5
|
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
package/dist/webpack4.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkKWG7VWW5js = require('./chunk-KWG7VWW5.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -27,10 +27,10 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkWPH7LL5Vjs = require('./chunk-WPH7LL5V.js');
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkQK6VNNNLjs = require('./chunk-QK6VNNNL.js');
|
|
34
34
|
require('./chunk-LL3QUKJI.js');
|
|
35
35
|
|
|
36
36
|
|
|
@@ -59,7 +59,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
59
59
|
debug: debug2
|
|
60
60
|
} = options;
|
|
61
61
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
62
|
-
compiler.hooks.emit.tapPromise(
|
|
62
|
+
compiler.hooks.emit.tapPromise(_chunkWPH7LL5Vjs.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 = _chunkKWG7VWW5js.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();
|
|
@@ -145,7 +145,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
145
145
|
return created;
|
|
146
146
|
};
|
|
147
147
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
148
|
-
const runtimeSet = await
|
|
148
|
+
const runtimeSet = await _chunkWPH7LL5Vjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
149
149
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
150
150
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
151
151
|
forceCollect: true,
|
|
@@ -191,7 +191,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
191
191
|
const jsTaskFactories = [];
|
|
192
192
|
if (Array.isArray(groupedEntries.js)) {
|
|
193
193
|
for (const [file] of groupedEntries.js) {
|
|
194
|
-
const cacheKey =
|
|
194
|
+
const cacheKey = _chunkKWG7VWW5js.getCacheKey.call(void 0, file);
|
|
195
195
|
const assetSource = compilation.assets[file];
|
|
196
196
|
if (!assetSource) {
|
|
197
197
|
continue;
|
|
@@ -295,9 +295,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
295
295
|
getClassSetInLoader,
|
|
296
296
|
debug: debug2
|
|
297
297
|
} = options;
|
|
298
|
-
const isMpxApp =
|
|
298
|
+
const isMpxApp = _chunkKWG7VWW5js.isMpx.call(void 0, appType);
|
|
299
299
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
300
|
-
|
|
300
|
+
_chunkKWG7VWW5js.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
301
301
|
}
|
|
302
302
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
303
303
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -310,12 +310,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
310
310
|
const classSetLoaderOptions = {
|
|
311
311
|
getClassSet: getClassSetInLoader
|
|
312
312
|
};
|
|
313
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
313
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkKWG7VWW5js.createLoaderAnchorFinders.call(void 0, appType);
|
|
314
314
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
315
315
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
316
316
|
} : void 0;
|
|
317
317
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
318
|
-
|
|
318
|
+
_chunkKWG7VWW5js.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
319
319
|
}
|
|
320
320
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
321
321
|
loader: runtimeClassSetLoader,
|
|
@@ -334,19 +334,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
334
334
|
type: null
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
|
-
compiler.hooks.compilation.tap(
|
|
338
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
337
|
+
compiler.hooks.compilation.tap(_chunkWPH7LL5Vjs.pluginName, (compilation) => {
|
|
338
|
+
compilation.hooks.normalModuleLoader.tap(_chunkWPH7LL5Vjs.pluginName, (_loaderContext, module) => {
|
|
339
339
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
340
340
|
if (!hasRuntimeLoader) {
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
if (shouldRewriteCssImports &&
|
|
344
|
-
|
|
343
|
+
if (shouldRewriteCssImports && _chunkKWG7VWW5js.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
344
|
+
_chunkKWG7VWW5js.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
345
345
|
}
|
|
346
346
|
const loaderEntries = module.loaders || [];
|
|
347
347
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
348
348
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
349
|
-
const isCssModule =
|
|
349
|
+
const isCssModule = _chunkKWG7VWW5js.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
350
350
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
351
351
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
352
352
|
}
|
|
@@ -380,7 +380,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
380
380
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
if (runtimeClassSetLoaderExists && !
|
|
383
|
+
if (runtimeClassSetLoaderExists && !_chunkKWG7VWW5js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
384
384
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
385
385
|
if (anchorIndex === -1) {
|
|
386
386
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -394,11 +394,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
397
|
-
var debug =
|
|
397
|
+
var debug = _chunkWPH7LL5Vjs.createDebug.call(void 0, );
|
|
398
398
|
var weappTailwindcssPackageDir = _chunk7LKMJZD2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
399
399
|
var UnifiedWebpackPluginV4 = class {
|
|
400
400
|
constructor(options = {}) {
|
|
401
|
-
this.options =
|
|
401
|
+
this.options = _chunkWPH7LL5Vjs.getCompilerContext.call(void 0, options);
|
|
402
402
|
this.appType = this.options.appType;
|
|
403
403
|
}
|
|
404
404
|
apply(compiler) {
|
|
@@ -414,19 +414,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
414
414
|
const disabledOptions = _chunk7LKMJZD2js.resolveDisabledOptions.call(void 0, disabled);
|
|
415
415
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
416
416
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
417
|
-
const isMpxApp =
|
|
417
|
+
const isMpxApp = _chunkKWG7VWW5js.isMpx.call(void 0, this.appType);
|
|
418
418
|
if (shouldRewriteCssImports) {
|
|
419
|
-
|
|
419
|
+
_chunkKWG7VWW5js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
420
420
|
pkgDir: weappTailwindcssPackageDir,
|
|
421
421
|
enabled: true,
|
|
422
422
|
appType: this.appType
|
|
423
423
|
});
|
|
424
|
-
|
|
424
|
+
_chunkKWG7VWW5js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
425
425
|
}
|
|
426
426
|
if (disabledOptions.plugin) {
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
const patchRecorderState =
|
|
429
|
+
const patchRecorderState = _chunkWPH7LL5Vjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
430
430
|
source: "runtime",
|
|
431
431
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
432
432
|
});
|
|
@@ -438,17 +438,17 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
438
438
|
};
|
|
439
439
|
let runtimeSetPrepared = false;
|
|
440
440
|
let runtimeSetSignature;
|
|
441
|
-
compiler.hooks.compilation.tap(
|
|
441
|
+
compiler.hooks.compilation.tap(_chunkWPH7LL5Vjs.pluginName, () => {
|
|
442
442
|
runtimeSetPrepared = false;
|
|
443
443
|
});
|
|
444
444
|
async function getClassSetInLoader() {
|
|
445
445
|
if (runtimeSetPrepared) {
|
|
446
446
|
return;
|
|
447
447
|
}
|
|
448
|
-
const signature =
|
|
448
|
+
const signature = _chunkQK6VNNNLjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
449
449
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
450
450
|
runtimeSetPrepared = true;
|
|
451
|
-
await
|
|
451
|
+
await _chunkWPH7LL5Vjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
452
452
|
forceRefresh,
|
|
453
453
|
forceCollect: true,
|
|
454
454
|
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-TSRWDW6S.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
getCompilerContext,
|
|
28
28
|
pluginName,
|
|
29
29
|
setupPatchRecorder
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VMKFA54Q.mjs";
|
|
31
31
|
import {
|
|
32
32
|
getRuntimeClassSetSignature
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OMARW5NC.mjs";
|
|
34
34
|
import "./chunk-23K4XDKF.mjs";
|
|
35
35
|
import {
|
|
36
36
|
getGroupedEntries
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.11.0-alpha.
|
|
3
|
+
"version": "4.11.0-alpha.6",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
"@weapp-core/escape": "~7.0.0",
|
|
174
174
|
"@weapp-core/regex": "~1.0.1",
|
|
175
175
|
"cac": "6.7.14",
|
|
176
|
+
"comment-json": "^4.6.2",
|
|
176
177
|
"debug": "~4.4.3",
|
|
177
178
|
"fast-glob": "^3.3.3",
|
|
178
179
|
"htmlparser2": "10.1.0",
|