weapp-tailwindcss 4.8.11 → 4.8.13
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-FM3FLOYY.js → chunk-3S6VRBOM.js} +5 -5
- package/dist/{chunk-HHSKDU3Z.mjs → chunk-3VIPMWAG.mjs} +22 -24
- package/dist/{chunk-LAVN5SDT.mjs → chunk-4E2U7YIQ.mjs} +2 -2
- package/dist/{chunk-3NLDVPXD.mjs → chunk-7MREZHFO.mjs} +2 -2
- package/dist/{chunk-6LNKARWD.js → chunk-B7643BFR.js} +28 -28
- package/dist/{chunk-22ETJBBT.js → chunk-BLTNVVBH.js} +127 -127
- package/dist/{chunk-FGNKGESE.mjs → chunk-CSDB62E5.mjs} +4 -4
- package/dist/{chunk-2SG4SGMQ.js → chunk-G4UFQ3CK.js} +7 -7
- package/dist/{chunk-45BMEACS.js → chunk-J4MI4EJO.js} +16 -18
- package/dist/{chunk-TWF4BQKE.mjs → chunk-JSV4IYLL.mjs} +2 -2
- package/dist/{chunk-CFFV3OIP.js → chunk-MB4BR57E.js} +1 -1
- package/dist/{chunk-W6ASDRWZ.mjs → chunk-OPA2EYQV.mjs} +1 -1
- package/dist/{chunk-SXBK4NF4.mjs → chunk-SM5V25IN.mjs} +1 -1
- package/dist/{chunk-DLSEDDLQ.js → chunk-U6O2TOS7.js} +22 -22
- package/dist/{chunk-BSGZZCLH.mjs → chunk-WHELJMZL.mjs} +109 -109
- package/dist/{chunk-FAKEMDGU.js → chunk-XX7SUSE7.js} +6 -6
- package/dist/{chunk-YXT3T3LH.js → chunk-Z6E242OH.js} +2 -2
- package/dist/cli.js +240 -168
- package/dist/cli.mjs +217 -145
- package/dist/core.js +10 -10
- package/dist/core.mjs +4 -4
- 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.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/index.js +10 -10
- package/dist/index.mjs +8 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +14 -10
- package/dist/presets.d.ts +14 -10
- package/dist/presets.js +68 -64
- package/dist/presets.mjs +69 -65
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +5 -5
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.js +31 -31
- package/dist/webpack4.mjs +5 -5
- package/package.json +5 -5
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
-
var
|
|
4
|
+
var _chunkBLTNVVBHjs = require('./chunk-BLTNVVBH.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkJ4MI4EJOjs = require('./chunk-J4MI4EJO.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkBLTNVVBHjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
|
|
12
12
|
if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
|
|
13
13
|
const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
|
|
14
|
-
|
|
14
|
+
_chunkJ4MI4EJOjs.logger.info("%s%s", prefix, recorder.message);
|
|
15
15
|
}
|
|
16
16
|
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
|
|
17
17
|
await recorder.onPatched();
|
|
18
18
|
} : void 0;
|
|
19
|
-
const patchPromise = patcher ?
|
|
19
|
+
const patchPromise = patcher ? _chunkBLTNVVBHjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -2,13 +2,8 @@ import {
|
|
|
2
2
|
defuOverrideArray
|
|
3
3
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
4
4
|
|
|
5
|
-
// src/
|
|
6
|
-
import {
|
|
7
|
-
import { createRequire as createRequire2 } from "module";
|
|
8
|
-
import path4 from "path";
|
|
9
|
-
import process2 from "process";
|
|
10
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
11
|
-
import { logger as logger4 } from "@weapp-tailwindcss/logger";
|
|
5
|
+
// src/logger/index.ts
|
|
6
|
+
import { logger } from "@weapp-tailwindcss/logger";
|
|
12
7
|
|
|
13
8
|
// src/context/workspace.ts
|
|
14
9
|
import { existsSync, readdirSync, readFileSync } from "fs";
|
|
@@ -95,7 +90,7 @@ function findWorkspacePackageDir(rootDir, packageName) {
|
|
|
95
90
|
}
|
|
96
91
|
|
|
97
92
|
// src/tailwindcss/v4/config.ts
|
|
98
|
-
import { logger } from "@weapp-tailwindcss/logger";
|
|
93
|
+
import { logger as logger2 } from "@weapp-tailwindcss/logger";
|
|
99
94
|
var DEFAULT_CSS_CALC_CUSTOM_PROPERTIES = [];
|
|
100
95
|
function includesToken(list, token) {
|
|
101
96
|
return list.some((candidate) => {
|
|
@@ -189,7 +184,7 @@ function warnMissingCssEntries(ctx, patcher) {
|
|
|
189
184
|
return;
|
|
190
185
|
}
|
|
191
186
|
hasWarnedMissingCssEntries = true;
|
|
192
|
-
|
|
187
|
+
logger2.warn(
|
|
193
188
|
'[tailwindcss@4] \u672A\u68C0\u6D4B\u5230 cssEntries \u914D\u7F6E\u3002\u8BF7\u4F20\u5165\u5305\u542B tailwindcss \u5F15\u7528\u7684 CSS \u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u4F8B\u5982 cssEntries: ["/absolute/path/to/src/app.css"]\uFF0C\u5426\u5219 tailwindcss \u751F\u6210\u7684\u7C7B\u540D\u4E0D\u4F1A\u53C2\u4E0E\u8F6C\u8BD1\u3002'
|
|
194
189
|
);
|
|
195
190
|
}
|
|
@@ -203,7 +198,7 @@ function applyV4CssCalcDefaults(cssCalc, patcher) {
|
|
|
203
198
|
|
|
204
199
|
// src/tailwindcss/v4/patcher.ts
|
|
205
200
|
import path3 from "path";
|
|
206
|
-
import { logger as
|
|
201
|
+
import { logger as logger4 } from "@weapp-tailwindcss/logger";
|
|
207
202
|
|
|
208
203
|
// src/tailwindcss/patcher.ts
|
|
209
204
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -211,7 +206,7 @@ import { createRequire } from "module";
|
|
|
211
206
|
import path2 from "path";
|
|
212
207
|
import process from "process";
|
|
213
208
|
import { fileURLToPath } from "url";
|
|
214
|
-
import { logger as
|
|
209
|
+
import { logger as logger3 } from "@weapp-tailwindcss/logger";
|
|
215
210
|
import { defuOverrideArray as defuOverrideArray2 } from "@weapp-tailwindcss/shared";
|
|
216
211
|
import { TailwindcssPatcher } from "tailwindcss-patch";
|
|
217
212
|
var GENERIC_RELATIVE_SPECIFIERS = [".", ".."];
|
|
@@ -495,7 +490,7 @@ function createTailwindcssPatcher(options) {
|
|
|
495
490
|
...existingResolve,
|
|
496
491
|
paths: Array.from(new Set(sourcePaths))
|
|
497
492
|
};
|
|
498
|
-
|
|
493
|
+
logger3.debug("Tailwind resolve config %O", {
|
|
499
494
|
packageName: resolvedOptions.tailwind.packageName,
|
|
500
495
|
version: resolvedOptions.tailwind.version,
|
|
501
496
|
resolve: resolvedOptions.tailwind.resolve,
|
|
@@ -542,13 +537,13 @@ function createTailwindcssPatcher(options) {
|
|
|
542
537
|
const searchPaths = resolvedOptions.tailwind?.resolve?.paths;
|
|
543
538
|
if (error instanceof Error && /tailwindcss not found/i.test(error.message)) {
|
|
544
539
|
if (!hasLoggedMissingTailwind) {
|
|
545
|
-
|
|
540
|
+
logger3.warn("Tailwind CSS \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7 Tailwind \u76F8\u5173\u8865\u4E01\u3002\u82E5\u9700\u4F7F\u7528 Tailwind \u80FD\u529B\uFF0C\u8BF7\u5B89\u88C5 tailwindcss\u3002");
|
|
546
541
|
hasLoggedMissingTailwind = true;
|
|
547
542
|
}
|
|
548
543
|
return createFallbackTailwindcssPatcher();
|
|
549
544
|
}
|
|
550
545
|
if (error instanceof Error && /unable to locate tailwind css package/i.test(error.message)) {
|
|
551
|
-
|
|
546
|
+
logger3.error('\u65E0\u6CD5\u5B9A\u4F4D Tailwind CSS \u5305 "%s"\uFF0C\u5DF2\u5C1D\u8BD5\u8DEF\u5F84: %O', resolvedOptions.tailwind?.packageName, searchPaths);
|
|
552
547
|
}
|
|
553
548
|
throw error;
|
|
554
549
|
}
|
|
@@ -849,7 +844,7 @@ function tryCreateMultiTailwindcssPatcher(groups, options) {
|
|
|
849
844
|
if (groups.size <= 1) {
|
|
850
845
|
return void 0;
|
|
851
846
|
}
|
|
852
|
-
|
|
847
|
+
logger4.debug("detected multiple Tailwind CSS entry bases: %O", [...groups.keys()]);
|
|
853
848
|
const patchers = [];
|
|
854
849
|
for (const [baseDir, entries] of groups) {
|
|
855
850
|
patchers.push(createPatcherForBase(baseDir, entries, options));
|
|
@@ -858,6 +853,12 @@ function tryCreateMultiTailwindcssPatcher(groups, options) {
|
|
|
858
853
|
}
|
|
859
854
|
|
|
860
855
|
// src/context/tailwindcss.ts
|
|
856
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
|
|
857
|
+
import { createRequire as createRequire2 } from "module";
|
|
858
|
+
import path4 from "path";
|
|
859
|
+
import process2 from "process";
|
|
860
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
861
|
+
import { logger as logger5 } from "@weapp-tailwindcss/logger";
|
|
861
862
|
var ENV_BASEDIR_KEYS = [
|
|
862
863
|
"WEAPP_TAILWINDCSS_BASEDIR",
|
|
863
864
|
"WEAPP_TAILWINDCSS_BASE_DIR",
|
|
@@ -900,7 +901,7 @@ function detectCallerBasedir() {
|
|
|
900
901
|
return void 0;
|
|
901
902
|
}
|
|
902
903
|
if (process2.env.WEAPP_TW_DEBUG_STACK === "1") {
|
|
903
|
-
|
|
904
|
+
logger5.debug("caller stack: %s", stack);
|
|
904
905
|
}
|
|
905
906
|
const lines = stack.split("\n");
|
|
906
907
|
for (const line of lines) {
|
|
@@ -945,7 +946,7 @@ function resolveTailwindcssBasedir(basedir, fallback) {
|
|
|
945
946
|
const anchor = envBasedir ?? packageEnvBasedir ?? fallback ?? callerBasedir ?? cwd;
|
|
946
947
|
const resolveRelative = (value) => path4.isAbsolute(value) ? path4.normalize(value) : path4.normalize(path4.resolve(anchor, value));
|
|
947
948
|
if (process2.env.WEAPP_TW_DEBUG_STACK === "1") {
|
|
948
|
-
|
|
949
|
+
logger5.debug("resolveTailwindcssBasedir anchor %O", {
|
|
949
950
|
basedir,
|
|
950
951
|
envBasedir,
|
|
951
952
|
envBasedirKey,
|
|
@@ -983,12 +984,12 @@ function resolveTailwindcssBasedir(basedir, fallback) {
|
|
|
983
984
|
const anchorRequire = createRequire2(path4.join(anchor, "__resolve_tailwindcss_basedir__.cjs"));
|
|
984
985
|
const packageJsonPath = anchorRequire.resolve(`${packageName}/package.json`);
|
|
985
986
|
if (process2.env.WEAPP_TW_DEBUG_STACK === "1") {
|
|
986
|
-
|
|
987
|
+
logger5.debug("package basedir resolved from PNPM_PACKAGE_NAME: %s", packageJsonPath);
|
|
987
988
|
}
|
|
988
989
|
return path4.normalize(path4.dirname(packageJsonPath));
|
|
989
990
|
} catch {
|
|
990
991
|
if (process2.env.WEAPP_TW_DEBUG_STACK === "1") {
|
|
991
|
-
|
|
992
|
+
logger5.debug("failed to resolve package json for %s", packageName);
|
|
992
993
|
}
|
|
993
994
|
const workspaceRoot = findWorkspaceRoot(anchor);
|
|
994
995
|
if (workspaceRoot) {
|
|
@@ -1076,7 +1077,7 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
1076
1077
|
const absoluteCssEntryBasedir = guessBasedirFromEntries(rawCssEntries);
|
|
1077
1078
|
const resolvedTailwindcssBasedir = resolveTailwindcssBasedir(tailwindcssBasedir, absoluteCssEntryBasedir);
|
|
1078
1079
|
ctx.tailwindcssBasedir = resolvedTailwindcssBasedir;
|
|
1079
|
-
|
|
1080
|
+
logger5.debug("tailwindcss basedir resolved: %s", resolvedTailwindcssBasedir);
|
|
1080
1081
|
let normalizedCssEntries = normalizeCssEntries(rawCssEntries, resolvedTailwindcssBasedir);
|
|
1081
1082
|
if (!normalizedCssEntries) {
|
|
1082
1083
|
normalizedCssEntries = detectImplicitCssEntries(ctx.appType, resolvedTailwindcssBasedir);
|
|
@@ -1114,9 +1115,6 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
1114
1115
|
);
|
|
1115
1116
|
}
|
|
1116
1117
|
|
|
1117
|
-
// src/logger/index.ts
|
|
1118
|
-
import { logger as logger5 } from "@weapp-tailwindcss/logger";
|
|
1119
|
-
|
|
1120
1118
|
export {
|
|
1121
1119
|
findWorkspaceRoot,
|
|
1122
1120
|
findNearestPackageRoot,
|
|
@@ -1124,5 +1122,5 @@ export {
|
|
|
1124
1122
|
applyV4CssCalcDefaults,
|
|
1125
1123
|
resolveTailwindcssBasedir,
|
|
1126
1124
|
createTailwindcssPatcherFromContext,
|
|
1127
|
-
|
|
1125
|
+
logger
|
|
1128
1126
|
};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-RRHPTTCP.mjs";
|
|
12
12
|
import {
|
|
13
13
|
setupPatchRecorder
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7MREZHFO.mjs";
|
|
15
15
|
import {
|
|
16
16
|
collectRuntimeClassSet,
|
|
17
17
|
createAttributeMatcher,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
replaceWxml,
|
|
23
23
|
toCustomAttributesEntities,
|
|
24
24
|
vitePluginName
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-WHELJMZL.mjs";
|
|
26
26
|
import {
|
|
27
27
|
getGroupedEntries
|
|
28
28
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPatchTargetRecorder,
|
|
3
3
|
createTailwindPatchPromise
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WHELJMZL.mjs";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3VIPMWAG.mjs";
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkXX7SUSE7js = require('./chunk-XX7SUSE7.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -15,20 +15,20 @@ var _chunkFAKEMDGUjs = require('./chunk-FAKEMDGU.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkZ6E242OHjs = require('./chunk-Z6E242OH.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunk3S6VRBOMjs = require('./chunk-3S6VRBOM.js');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkBLTNVVBHjs = require('./chunk-BLTNVVBH.js');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -37,11 +37,11 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
|
37
37
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
38
38
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
39
39
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
40
|
-
var debug =
|
|
41
|
-
var weappTailwindcssPackageDir =
|
|
40
|
+
var debug = _chunkBLTNVVBHjs.createDebug.call(void 0, );
|
|
41
|
+
var weappTailwindcssPackageDir = _chunkZ6E242OHjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
42
42
|
var UnifiedWebpackPluginV5 = class {
|
|
43
43
|
constructor(options = {}) {
|
|
44
|
-
this.options =
|
|
44
|
+
this.options = _chunkBLTNVVBHjs.getCompilerContext.call(void 0, options);
|
|
45
45
|
this.appType = this.options.appType;
|
|
46
46
|
}
|
|
47
47
|
apply(compiler) {
|
|
@@ -67,16 +67,16 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
67
67
|
}
|
|
68
68
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
69
69
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false;
|
|
70
|
-
const isMpxApp =
|
|
70
|
+
const isMpxApp = _chunkZ6E242OHjs.isMpx.call(void 0, this.appType);
|
|
71
71
|
if (shouldRewriteCssImports) {
|
|
72
|
-
|
|
72
|
+
_chunkXX7SUSE7js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
73
73
|
pkgDir: weappTailwindcssPackageDir,
|
|
74
74
|
enabled: true,
|
|
75
75
|
appType: this.appType
|
|
76
76
|
});
|
|
77
|
-
|
|
77
|
+
_chunkZ6E242OHjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
78
78
|
}
|
|
79
|
-
const patchRecorderState =
|
|
79
|
+
const patchRecorderState = _chunk3S6VRBOMjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
80
80
|
source: "runtime",
|
|
81
81
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
82
82
|
});
|
|
@@ -87,14 +87,14 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
87
87
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
88
88
|
};
|
|
89
89
|
const refreshRuntimeState = async (force) => {
|
|
90
|
-
await
|
|
90
|
+
await _chunkBLTNVVBHjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
91
91
|
};
|
|
92
92
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
93
93
|
const { ConcatSource } = sources;
|
|
94
94
|
async function getClassSetInLoader() {
|
|
95
95
|
await refreshRuntimeState(true);
|
|
96
96
|
await runtimeState.patchPromise;
|
|
97
|
-
await
|
|
97
|
+
await _chunkBLTNVVBHjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
98
98
|
}
|
|
99
99
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
100
100
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -107,16 +107,16 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
107
107
|
const classSetLoaderOptions = {
|
|
108
108
|
getClassSet: getClassSetInLoader
|
|
109
109
|
};
|
|
110
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
110
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkXX7SUSE7js.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
111
111
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
112
112
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
113
113
|
} : void 0;
|
|
114
114
|
onLoad();
|
|
115
115
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
116
|
-
|
|
116
|
+
_chunkZ6E242OHjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
117
117
|
}
|
|
118
118
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
119
|
-
|
|
119
|
+
_chunkZ6E242OHjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
120
120
|
}
|
|
121
121
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
122
122
|
loader: runtimeClassSetLoader,
|
|
@@ -135,17 +135,17 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
135
135
|
type: null
|
|
136
136
|
};
|
|
137
137
|
};
|
|
138
|
-
compiler.hooks.compilation.tap(
|
|
139
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
138
|
+
compiler.hooks.compilation.tap(_chunkBLTNVVBHjs.pluginName, (compilation) => {
|
|
139
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkBLTNVVBHjs.pluginName, (_loaderContext, module) => {
|
|
140
140
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
141
141
|
if (!hasRuntimeLoader) {
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
_chunkZ6E242OHjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
|
|
145
145
|
const loaderEntries = module.loaders || [];
|
|
146
146
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
147
147
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
148
|
-
const isCssModule =
|
|
148
|
+
const isCssModule = _chunkXX7SUSE7js.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
149
149
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
150
150
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
151
151
|
}
|
|
@@ -177,7 +177,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
177
177
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
if (runtimeClassSetLoaderExists && !
|
|
180
|
+
if (runtimeClassSetLoaderExists && !_chunkXX7SUSE7js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
181
181
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
182
182
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
183
183
|
if (anchorIndex === -1) {
|
|
@@ -190,7 +190,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
190
190
|
});
|
|
191
191
|
compilation.hooks.processAssets.tapPromise(
|
|
192
192
|
{
|
|
193
|
-
name:
|
|
193
|
+
name: _chunkBLTNVVBHjs.pluginName,
|
|
194
194
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
195
195
|
},
|
|
196
196
|
async (assets) => {
|
|
@@ -208,13 +208,13 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
208
208
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
209
209
|
for (const [file] of entries) {
|
|
210
210
|
if (this.options.jsMatcher(file) || this.options.wxsMatcher(file)) {
|
|
211
|
-
const absolute =
|
|
211
|
+
const absolute = _chunkZ6E242OHjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
212
212
|
jsAssets.set(absolute, file);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
const moduleGraphOptions = {
|
|
216
216
|
resolve(specifier, importer) {
|
|
217
|
-
return
|
|
217
|
+
return _chunkZ6E242OHjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
218
218
|
},
|
|
219
219
|
load: (id) => {
|
|
220
220
|
const assetName = jsAssets.get(id);
|
|
@@ -259,7 +259,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
259
259
|
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
|
|
260
260
|
await refreshRuntimeState(true);
|
|
261
261
|
await runtimeState.patchPromise;
|
|
262
|
-
const runtimeSet = await
|
|
262
|
+
const runtimeSet = await _chunkBLTNVVBHjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
263
263
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
264
264
|
const tasks = [];
|
|
265
265
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -296,12 +296,12 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
296
296
|
const jsTaskFactories = [];
|
|
297
297
|
if (Array.isArray(groupedEntries.js)) {
|
|
298
298
|
for (const [file] of groupedEntries.js) {
|
|
299
|
-
const cacheKey =
|
|
299
|
+
const cacheKey = _chunkXX7SUSE7js.getCacheKey.call(void 0, file);
|
|
300
300
|
const asset = compilation.getAsset(file);
|
|
301
301
|
if (!asset) {
|
|
302
302
|
continue;
|
|
303
303
|
}
|
|
304
|
-
const absoluteFile =
|
|
304
|
+
const absoluteFile = _chunkZ6E242OHjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
305
305
|
const initialSource = asset.source.source();
|
|
306
306
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
307
307
|
jsTaskFactories.push(async () => {
|
|
@@ -376,7 +376,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
376
376
|
);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
|
|
379
|
+
_chunkZ6E242OHjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
380
380
|
await Promise.all(tasks);
|
|
381
381
|
debug("end");
|
|
382
382
|
onEnd();
|