weapp-tailwindcss 4.8.8 → 4.8.10
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-UTCO4JMJ.mjs → chunk-B7QESXH4.mjs} +10 -12
- package/dist/{chunk-IH3HQU7U.mjs → chunk-BZXRUB2B.mjs} +3 -3
- package/dist/{chunk-M4NERJO7.js → chunk-CFFV3OIP.js} +1 -1
- package/dist/{chunk-FB3ASCHC.mjs → chunk-HFAC5AYM.mjs} +2 -2
- package/dist/{chunk-RYGPCUUT.mjs → chunk-HXYNNE6Q.mjs} +118 -6
- package/dist/{chunk-2E724WCE.js → chunk-INF2Q5LI.js} +6 -8
- package/dist/{chunk-6TO3GT5S.mjs → chunk-IXK4ZWFR.mjs} +47 -165
- package/dist/{chunk-RUXC4E2M.mjs → chunk-JCG2LT63.mjs} +10 -5
- package/dist/{chunk-2KZ4VTIA.js → chunk-MNZW5VG5.js} +15 -10
- package/dist/{chunk-WF4UE272.js → chunk-OACITA4W.js} +22 -22
- package/dist/{chunk-M5UEOYBI.mjs → chunk-OBOKBKZQ.mjs} +2 -2
- package/dist/{chunk-3IP5JCFZ.mjs → chunk-SXBK4NF4.mjs} +1 -1
- package/dist/{chunk-E7PFK6BW.js → chunk-VMX23GDK.js} +29 -31
- package/dist/{chunk-P3AQCOOM.js → chunk-W7H4R6CP.js} +32 -150
- package/dist/{chunk-L5ER4544.js → chunk-XP5623NL.js} +5 -5
- package/dist/{chunk-PVJDRL3I.mjs → chunk-XXO2FHP7.mjs} +3 -5
- package/dist/{chunk-Y5XG47XY.js → chunk-YM3HBJ3Q.js} +7 -7
- package/dist/{chunk-XHR5K5ZT.js → chunk-YXT3T3LH.js} +122 -9
- package/dist/cli.js +29 -29
- package/dist/cli.mjs +3 -3
- 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 +9 -9
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +4 -4
- package/dist/presets.mjs +2 -2
- 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 +6 -6
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +7 -7
- package/dist/webpack4.js +32 -33
- package/dist/webpack4.mjs +11 -12
- package/package.json +5 -4
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkYXT3T3LHjs = require('./chunk-YXT3T3LH.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkXP5623NLjs = require('./chunk-XP5623NL.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -22,7 +22,7 @@ var _chunkL5ER4544js = require('./chunk-L5ER4544.js');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkMNZW5VG5js = require('./chunk-MNZW5VG5.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -54,7 +54,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
54
54
|
const start = prop.value.loc.start.offset + 1;
|
|
55
55
|
const end = prop.value.loc.end.offset - 1;
|
|
56
56
|
if (start < end) {
|
|
57
|
-
ms.update(start, end,
|
|
57
|
+
ms.update(start, end, _chunkMNZW5VG5js.replaceWxml.call(void 0, prop.value.content));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -66,7 +66,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
66
66
|
if (start >= end) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const generated =
|
|
69
|
+
const generated = _chunkMNZW5VG5js.generateCode.call(void 0, prop.exp.content, {
|
|
70
70
|
jsHandler,
|
|
71
71
|
runtimeSet,
|
|
72
72
|
wrapExpression: true
|
|
@@ -95,7 +95,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
98
|
-
const matchCustomAttribute =
|
|
98
|
+
const matchCustomAttribute = _chunkMNZW5VG5js.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
99
99
|
const ms = new (0, _magicstring2.default)(code);
|
|
100
100
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
101
101
|
if (errors.length === 0) {
|
|
@@ -326,7 +326,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
326
326
|
runtimeSet,
|
|
327
327
|
applyLinkedResults: applyLinkedResults2
|
|
328
328
|
} = options;
|
|
329
|
-
const absoluteFile =
|
|
329
|
+
const absoluteFile = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
330
330
|
const rawSource = originalSource.source.toString();
|
|
331
331
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
332
332
|
cache,
|
|
@@ -361,8 +361,8 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
// src/bundlers/vite/index.ts
|
|
364
|
-
var debug =
|
|
365
|
-
var weappTailwindcssPackageDir =
|
|
364
|
+
var debug = _chunkMNZW5VG5js.createDebug.call(void 0, );
|
|
365
|
+
var weappTailwindcssPackageDir = _chunkYXT3T3LHjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
366
366
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
367
367
|
function joinPosixPath(base, subpath) {
|
|
368
368
|
if (base.endsWith("/")) {
|
|
@@ -406,7 +406,7 @@ function isJavaScriptEntry(entry) {
|
|
|
406
406
|
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
407
407
|
return {
|
|
408
408
|
resolve(specifier, importer) {
|
|
409
|
-
return
|
|
409
|
+
return _chunkYXT3T3LHjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
|
|
410
410
|
},
|
|
411
411
|
load(id) {
|
|
412
412
|
const entry = entries.get(id);
|
|
@@ -444,7 +444,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
444
444
|
}
|
|
445
445
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
446
446
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
447
|
-
const opts =
|
|
447
|
+
const opts = _chunkMNZW5VG5js.getCompilerContext.call(void 0, options);
|
|
448
448
|
const {
|
|
449
449
|
disabled,
|
|
450
450
|
customAttributes,
|
|
@@ -466,8 +466,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
466
466
|
if (disabled) {
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
|
-
const customAttributesEntities =
|
|
470
|
-
const patchRecorderState =
|
|
469
|
+
const customAttributesEntities = _chunkMNZW5VG5js.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
470
|
+
const patchRecorderState = _chunkXP5623NLjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
471
471
|
source: "runtime",
|
|
472
472
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
473
473
|
});
|
|
@@ -481,7 +481,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
481
481
|
let runtimeSetPromise;
|
|
482
482
|
let resolvedConfig;
|
|
483
483
|
async function refreshRuntimeState(force) {
|
|
484
|
-
const refreshed = await
|
|
484
|
+
const refreshed = await _chunkMNZW5VG5js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
485
485
|
if (refreshed) {
|
|
486
486
|
runtimeSet = void 0;
|
|
487
487
|
runtimeSetPromise = void 0;
|
|
@@ -494,7 +494,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
494
494
|
return runtimeSet;
|
|
495
495
|
}
|
|
496
496
|
if (force || !runtimeSetPromise) {
|
|
497
|
-
const task2 =
|
|
497
|
+
const task2 = _chunkMNZW5VG5js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
498
498
|
force: force || !runtimeSet,
|
|
499
499
|
skipRefresh: force
|
|
500
500
|
});
|
|
@@ -514,12 +514,12 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
514
514
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && (rewriteCssImportsSpecified || (_nullishCoalesce(runtimeState.twPatcher.majorVersion, () => ( 0))) >= 4);
|
|
515
515
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
516
516
|
{
|
|
517
|
-
name: `${
|
|
517
|
+
name: `${_chunkMNZW5VG5js.vitePluginName}:rewrite-css-imports`,
|
|
518
518
|
enforce: "pre",
|
|
519
519
|
resolveId: {
|
|
520
520
|
order: "pre",
|
|
521
521
|
handler(id, importer) {
|
|
522
|
-
const replacement =
|
|
522
|
+
const replacement = _chunkYXT3T3LHjs.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
|
|
523
523
|
join: joinPosixPath,
|
|
524
524
|
appType
|
|
525
525
|
});
|
|
@@ -538,7 +538,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
538
538
|
if (!isCSSRequest(id)) {
|
|
539
539
|
return null;
|
|
540
540
|
}
|
|
541
|
-
const rewritten =
|
|
541
|
+
const rewritten = _chunkYXT3T3LHjs.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
|
|
542
542
|
join: joinPosixPath,
|
|
543
543
|
appType
|
|
544
544
|
});
|
|
@@ -568,7 +568,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
568
568
|
const plugins = [
|
|
569
569
|
...rewritePlugins,
|
|
570
570
|
{
|
|
571
|
-
name: `${
|
|
571
|
+
name: `${_chunkMNZW5VG5js.vitePluginName}:post`,
|
|
572
572
|
enforce: "post",
|
|
573
573
|
configResolved(config) {
|
|
574
574
|
resolvedConfig = config;
|
|
@@ -594,7 +594,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
594
594
|
for (const [fileName, output] of entries) {
|
|
595
595
|
const entry = { fileName, output };
|
|
596
596
|
if (isJavaScriptEntry(entry)) {
|
|
597
|
-
const absolute =
|
|
597
|
+
const absolute = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, fileName, outDir);
|
|
598
598
|
jsEntries.set(absolute, entry);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
@@ -661,7 +661,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
661
661
|
if (Array.isArray(groupedEntries.js)) {
|
|
662
662
|
for (const [file, originalSource] of groupedEntries.js) {
|
|
663
663
|
if (originalSource.type === "chunk") {
|
|
664
|
-
const absoluteFile =
|
|
664
|
+
const absoluteFile = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
665
665
|
const initialRawSource = originalSource.code;
|
|
666
666
|
jsTaskFactories.push(async () => {
|
|
667
667
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
@@ -742,7 +742,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
742
742
|
);
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
|
-
|
|
745
|
+
_chunkYXT3T3LHjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
746
746
|
await Promise.all(tasks);
|
|
747
747
|
for (const apply of pendingLinkedUpdates) {
|
|
748
748
|
apply();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPatchTargetRecorder,
|
|
3
3
|
createTailwindPatchPromise
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JCG2LT63.mjs";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IXK4ZWFR.mjs";
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.2__@swc+core@1.15.3_@swc+h_b5f09ec5c50315727a8dc02bf80354c5/node_modules/tsup/assets/esm_shims.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -4,33 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkINF2Q5LIjs = require('./chunk-INF2Q5LI.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var _chunkXHR5K5ZTjs = require('./chunk-XHR5K5ZT.js');
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
17
|
-
|
|
18
15
|
|
|
19
|
-
var _chunkL5ER4544js = require('./chunk-L5ER4544.js');
|
|
20
16
|
|
|
21
17
|
|
|
18
|
+
var _chunkYXT3T3LHjs = require('./chunk-YXT3T3LH.js');
|
|
22
19
|
|
|
23
20
|
|
|
21
|
+
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
24
22
|
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _chunkXP5623NLjs = require('./chunk-XP5623NL.js');
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
|
|
32
30
|
|
|
33
|
-
var
|
|
31
|
+
var _chunkMNZW5VG5js = require('./chunk-MNZW5VG5.js');
|
|
34
32
|
|
|
35
33
|
|
|
36
34
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -39,11 +37,11 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
|
39
37
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
40
38
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
41
39
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
42
|
-
var debug =
|
|
43
|
-
var weappTailwindcssPackageDir =
|
|
40
|
+
var debug = _chunkMNZW5VG5js.createDebug.call(void 0, );
|
|
41
|
+
var weappTailwindcssPackageDir = _chunkYXT3T3LHjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
44
42
|
var UnifiedWebpackPluginV5 = class {
|
|
45
43
|
constructor(options = {}) {
|
|
46
|
-
this.options =
|
|
44
|
+
this.options = _chunkMNZW5VG5js.getCompilerContext.call(void 0, options);
|
|
47
45
|
this.appType = this.options.appType;
|
|
48
46
|
}
|
|
49
47
|
apply(compiler) {
|
|
@@ -69,16 +67,16 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
69
67
|
}
|
|
70
68
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
71
69
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false;
|
|
72
|
-
const isMpxApp =
|
|
70
|
+
const isMpxApp = _chunkYXT3T3LHjs.isMpx.call(void 0, this.appType);
|
|
73
71
|
if (shouldRewriteCssImports) {
|
|
74
|
-
|
|
72
|
+
_chunkINF2Q5LIjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
75
73
|
pkgDir: weappTailwindcssPackageDir,
|
|
76
74
|
enabled: true,
|
|
77
75
|
appType: this.appType
|
|
78
76
|
});
|
|
79
|
-
|
|
77
|
+
_chunkYXT3T3LHjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
80
78
|
}
|
|
81
|
-
const patchRecorderState =
|
|
79
|
+
const patchRecorderState = _chunkXP5623NLjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
82
80
|
source: "runtime",
|
|
83
81
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
84
82
|
});
|
|
@@ -89,14 +87,14 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
89
87
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
90
88
|
};
|
|
91
89
|
const refreshRuntimeState = async (force) => {
|
|
92
|
-
await
|
|
90
|
+
await _chunkMNZW5VG5js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
93
91
|
};
|
|
94
92
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
95
93
|
const { ConcatSource } = sources;
|
|
96
94
|
async function getClassSetInLoader() {
|
|
97
95
|
await refreshRuntimeState(true);
|
|
98
96
|
await runtimeState.patchPromise;
|
|
99
|
-
await
|
|
97
|
+
await _chunkMNZW5VG5js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
100
98
|
}
|
|
101
99
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
102
100
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -109,16 +107,16 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
109
107
|
const classSetLoaderOptions = {
|
|
110
108
|
getClassSet: getClassSetInLoader
|
|
111
109
|
};
|
|
112
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
110
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkINF2Q5LIjs.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
113
111
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
114
112
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
115
113
|
} : void 0;
|
|
116
114
|
onLoad();
|
|
117
115
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
118
|
-
|
|
116
|
+
_chunkYXT3T3LHjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
119
117
|
}
|
|
120
118
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
121
|
-
|
|
119
|
+
_chunkYXT3T3LHjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
122
120
|
}
|
|
123
121
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
124
122
|
loader: runtimeClassSetLoader,
|
|
@@ -137,17 +135,17 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
137
135
|
type: null
|
|
138
136
|
};
|
|
139
137
|
};
|
|
140
|
-
compiler.hooks.compilation.tap(
|
|
141
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
138
|
+
compiler.hooks.compilation.tap(_chunkMNZW5VG5js.pluginName, (compilation) => {
|
|
139
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkMNZW5VG5js.pluginName, (_loaderContext, module) => {
|
|
142
140
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
143
141
|
if (!hasRuntimeLoader) {
|
|
144
142
|
return;
|
|
145
143
|
}
|
|
146
|
-
|
|
144
|
+
_chunkYXT3T3LHjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
|
|
147
145
|
const loaderEntries = module.loaders || [];
|
|
148
146
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
149
147
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
150
|
-
const isCssModule =
|
|
148
|
+
const isCssModule = _chunkINF2Q5LIjs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
151
149
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
152
150
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
153
151
|
}
|
|
@@ -179,7 +177,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
179
177
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
180
178
|
}
|
|
181
179
|
}
|
|
182
|
-
if (runtimeClassSetLoaderExists && !
|
|
180
|
+
if (runtimeClassSetLoaderExists && !_chunkINF2Q5LIjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
183
181
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
184
182
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
185
183
|
if (anchorIndex === -1) {
|
|
@@ -192,7 +190,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
192
190
|
});
|
|
193
191
|
compilation.hooks.processAssets.tapPromise(
|
|
194
192
|
{
|
|
195
|
-
name:
|
|
193
|
+
name: _chunkMNZW5VG5js.pluginName,
|
|
196
194
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
197
195
|
},
|
|
198
196
|
async (assets) => {
|
|
@@ -210,13 +208,13 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
210
208
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
211
209
|
for (const [file] of entries) {
|
|
212
210
|
if (this.options.jsMatcher(file) || this.options.wxsMatcher(file)) {
|
|
213
|
-
const absolute =
|
|
211
|
+
const absolute = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
214
212
|
jsAssets.set(absolute, file);
|
|
215
213
|
}
|
|
216
214
|
}
|
|
217
215
|
const moduleGraphOptions = {
|
|
218
216
|
resolve(specifier, importer) {
|
|
219
|
-
return
|
|
217
|
+
return _chunkYXT3T3LHjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
220
218
|
},
|
|
221
219
|
load: (id) => {
|
|
222
220
|
const assetName = jsAssets.get(id);
|
|
@@ -261,7 +259,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
261
259
|
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
|
|
262
260
|
await refreshRuntimeState(true);
|
|
263
261
|
await runtimeState.patchPromise;
|
|
264
|
-
const runtimeSet = await
|
|
262
|
+
const runtimeSet = await _chunkMNZW5VG5js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
265
263
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
266
264
|
const tasks = [];
|
|
267
265
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -298,12 +296,12 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
298
296
|
const jsTaskFactories = [];
|
|
299
297
|
if (Array.isArray(groupedEntries.js)) {
|
|
300
298
|
for (const [file] of groupedEntries.js) {
|
|
301
|
-
const cacheKey =
|
|
299
|
+
const cacheKey = _chunkINF2Q5LIjs.getCacheKey.call(void 0, file);
|
|
302
300
|
const asset = compilation.getAsset(file);
|
|
303
301
|
if (!asset) {
|
|
304
302
|
continue;
|
|
305
303
|
}
|
|
306
|
-
const absoluteFile =
|
|
304
|
+
const absoluteFile = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
307
305
|
const initialSource = asset.source.source();
|
|
308
306
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
309
307
|
jsTaskFactories.push(async () => {
|
|
@@ -378,7 +376,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
378
376
|
);
|
|
379
377
|
}
|
|
380
378
|
}
|
|
381
|
-
|
|
379
|
+
_chunkYXT3T3LHjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
382
380
|
await Promise.all(tasks);
|
|
383
381
|
debug("end");
|
|
384
382
|
onEnd();
|