weapp-tailwindcss 4.9.2-alpha.1 → 4.9.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-W3Z55EVM.mjs → chunk-2L6NDZIQ.mjs} +2 -2
- package/dist/{chunk-ORSWL3MI.js → chunk-2WPTDMN3.js} +2 -2
- package/dist/{chunk-FAUL26KB.mjs → chunk-5AKI6FQP.mjs} +4 -4
- package/dist/{chunk-Y4A76SWP.js → chunk-5O6237HX.js} +37 -29
- package/dist/{chunk-VZLUWOGQ.mjs → chunk-CBOVUIXD.mjs} +1 -1
- package/dist/{chunk-EOCBETCN.js → chunk-DNRNFN4I.js} +5 -5
- package/dist/{chunk-OU6P3233.mjs → chunk-DSD5JRCQ.mjs} +2 -2
- package/dist/{chunk-SM5V25IN.mjs → chunk-FFGR5V3H.mjs} +1 -1
- package/dist/{chunk-GKFJPK5V.mjs → chunk-G5OV7IOU.mjs} +2 -2
- package/dist/{chunk-O2XZFBRS.js → chunk-SNEMGP42.js} +29 -29
- package/dist/{chunk-IC2XBOKV.js → chunk-U7BH6QHE.js} +23 -23
- package/dist/{chunk-MB4BR57E.js → chunk-UAEME5HT.js} +1 -1
- package/dist/{chunk-HNNJH4ZX.js → chunk-VU2GIXVH.js} +7 -7
- package/dist/{chunk-2QR4UOHA.js → chunk-W3MTTQ5M.js} +5 -5
- package/dist/{chunk-IK5SFZ6A.mjs → chunk-WGBJY2H3.mjs} +2 -2
- package/dist/{chunk-D2ZOXBOU.js → chunk-XXJNXESJ.js} +7 -7
- package/dist/{chunk-3LRQLHOG.mjs → chunk-ZE7JKKFT.mjs} +15 -7
- package/dist/cli.js +39 -39
- 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 +8 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +5 -5
- 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 +5 -5
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.js +32 -32
- package/dist/webpack4.mjs +5 -5
- package/package.json +4 -4
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G5OV7IOU.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WGBJY2H3.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
var
|
|
3
|
+
var _chunkUAEME5HTjs = require('./chunk-UAEME5HT.js');
|
|
4
4
|
|
|
5
5
|
// src/bundlers/shared/module-graph.ts
|
|
6
6
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -74,7 +74,7 @@ function resolveDisabledOptions(disabled) {
|
|
|
74
74
|
// src/utils/resolve-package.ts
|
|
75
75
|
var _module = require('module');
|
|
76
76
|
|
|
77
|
-
var require2 = _module.createRequire.call(void 0,
|
|
77
|
+
var require2 = _module.createRequire.call(void 0, _chunkUAEME5HTjs.importMetaUrl);
|
|
78
78
|
function resolvePackageDir(name) {
|
|
79
79
|
const pkgPath = require2.resolve(`${name}/package.json`);
|
|
80
80
|
return _path2.default.dirname(pkgPath);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CBOVUIXD.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,20 +22,20 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-G5OV7IOU.mjs";
|
|
26
26
|
import {
|
|
27
27
|
collectRuntimeClassSet,
|
|
28
28
|
createDebug,
|
|
29
29
|
getCompilerContext,
|
|
30
30
|
pluginName,
|
|
31
31
|
refreshTailwindRuntimeState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WGBJY2H3.mjs";
|
|
33
33
|
import {
|
|
34
34
|
getGroupedEntries
|
|
35
35
|
} from "./chunk-OOHJLO5M.mjs";
|
|
36
36
|
import {
|
|
37
37
|
__dirname
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-FFGR5V3H.mjs";
|
|
39
39
|
|
|
40
40
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
41
41
|
import fs from "fs";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUAEME5HTjs = require('./chunk-UAEME5HT.js');
|
|
7
7
|
|
|
8
8
|
// src/logger/index.ts
|
|
9
9
|
var _logger = require('@weapp-tailwindcss/logger');
|
|
@@ -234,7 +234,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
234
234
|
return void 0;
|
|
235
235
|
}
|
|
236
236
|
try {
|
|
237
|
-
const req = _module.createRequire.call(void 0,
|
|
237
|
+
const req = _module.createRequire.call(void 0, _chunkUAEME5HTjs.importMetaUrl);
|
|
238
238
|
return req.resolve(specifier, { paths });
|
|
239
239
|
} catch (e3) {
|
|
240
240
|
return void 0;
|
|
@@ -334,11 +334,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
334
334
|
const cwd = _process2.default.cwd();
|
|
335
335
|
appendNodeModules(paths, cwd);
|
|
336
336
|
try {
|
|
337
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
337
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkUAEME5HTjs.importMetaUrl);
|
|
338
338
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
339
339
|
paths.add(candidate);
|
|
340
340
|
} catch (e4) {
|
|
341
|
-
paths.add(
|
|
341
|
+
paths.add(_chunkUAEME5HTjs.importMetaUrl);
|
|
342
342
|
}
|
|
343
343
|
if (paths.size === 0) {
|
|
344
344
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -640,6 +640,7 @@ function groupCssEntriesByBase(entries, options = {}) {
|
|
|
640
640
|
return groups;
|
|
641
641
|
}
|
|
642
642
|
function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries) {
|
|
643
|
+
const hasCssEntries = cssEntries.length > 0;
|
|
643
644
|
if (!options) {
|
|
644
645
|
return options;
|
|
645
646
|
}
|
|
@@ -654,13 +655,20 @@ function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries)
|
|
|
654
655
|
cwd: _nullishCoalesce(patchOptions.cwd, () => ( baseDir))
|
|
655
656
|
};
|
|
656
657
|
if (patchOptions.tailwindcss) {
|
|
658
|
+
const nextV4 = {
|
|
659
|
+
..._nullishCoalesce(patchOptions.tailwindcss.v4, () => ( {}))
|
|
660
|
+
};
|
|
661
|
+
if (hasCssEntries) {
|
|
662
|
+
nextV4.cssEntries = cssEntries;
|
|
663
|
+
} else {
|
|
664
|
+
nextV4.cssEntries = _nullishCoalesce(nextV4.cssEntries, () => ( cssEntries));
|
|
665
|
+
if (nextV4.base === void 0) {
|
|
666
|
+
nextV4.base = baseDir;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
657
669
|
nextPatch.tailwindcss = {
|
|
658
670
|
...patchOptions.tailwindcss,
|
|
659
|
-
v4:
|
|
660
|
-
..._nullishCoalesce(patchOptions.tailwindcss.v4, () => ( {})),
|
|
661
|
-
base: baseDir,
|
|
662
|
-
cssEntries
|
|
663
|
-
}
|
|
671
|
+
v4: nextV4
|
|
664
672
|
};
|
|
665
673
|
}
|
|
666
674
|
return {
|
|
@@ -680,8 +688,8 @@ function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries)
|
|
|
680
688
|
...options.tailwind,
|
|
681
689
|
v4: {
|
|
682
690
|
..._nullishCoalesce(options.tailwind.v4, () => ( {})),
|
|
683
|
-
base: baseDir,
|
|
684
|
-
cssEntries
|
|
691
|
+
...hasCssEntries ? {} : { base: _nullishCoalesce(_optionalChain([options, 'access', _40 => _40.tailwind, 'access', _41 => _41.v4, 'optionalAccess', _42 => _42.base]), () => ( baseDir)) },
|
|
692
|
+
cssEntries: hasCssEntries ? cssEntries : _nullishCoalesce(_optionalChain([options, 'access', _43 => _43.tailwind, 'access', _44 => _44.v4, 'optionalAccess', _45 => _45.cssEntries]), () => ( cssEntries))
|
|
685
693
|
}
|
|
686
694
|
}
|
|
687
695
|
};
|
|
@@ -692,7 +700,7 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
692
700
|
tailwindcssPatcherOptions,
|
|
693
701
|
supportCustomLengthUnitsPatch
|
|
694
702
|
} = options;
|
|
695
|
-
const hasCssEntries = Boolean(_optionalChain([cssEntries, 'optionalAccess',
|
|
703
|
+
const hasCssEntries = Boolean(_optionalChain([cssEntries, 'optionalAccess', _46 => _46.length]));
|
|
696
704
|
const defaultTailwindcssConfig = {
|
|
697
705
|
cwd: baseDir,
|
|
698
706
|
v2: {
|
|
@@ -723,7 +731,7 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
723
731
|
mergedTailwindOptions.v4.base = baseDir;
|
|
724
732
|
}
|
|
725
733
|
if (hasCssEntries) {
|
|
726
|
-
if (_optionalChain([cssEntries, 'optionalAccess',
|
|
734
|
+
if (_optionalChain([cssEntries, 'optionalAccess', _47 => _47.length])) {
|
|
727
735
|
mergedTailwindOptions.v4.cssEntries = cssEntries;
|
|
728
736
|
} else if (!mergedTailwindOptions.v4.cssEntries) {
|
|
729
737
|
mergedTailwindOptions.v4.cssEntries = [];
|
|
@@ -737,8 +745,8 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
737
745
|
baseDir,
|
|
738
746
|
_nullishCoalesce(cssEntries, () => ( []))
|
|
739
747
|
);
|
|
740
|
-
const configuredPackageName = _optionalChain([tailwindcss, 'optionalAccess',
|
|
741
|
-
const configuredVersion = _optionalChain([tailwindcss, 'optionalAccess',
|
|
748
|
+
const configuredPackageName = _optionalChain([tailwindcss, 'optionalAccess', _48 => _48.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _49 => _49.tailwind, 'optionalAccess', _50 => _50.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _51 => _51.patch, 'optionalAccess', _52 => _52.tailwindcss, 'optionalAccess', _53 => _53.packageName]);
|
|
749
|
+
const configuredVersion = _optionalChain([tailwindcss, 'optionalAccess', _54 => _54.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _55 => _55.tailwind, 'optionalAccess', _56 => _56.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _57 => _57.patch, 'optionalAccess', _58 => _58.tailwindcss, 'optionalAccess', _59 => _59.version]) || mergedTailwindOptions.version;
|
|
742
750
|
const isTailwindcss4Package = (packageName) => Boolean(
|
|
743
751
|
packageName && (packageName === "tailwindcss4" || packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4"))
|
|
744
752
|
);
|
|
@@ -773,18 +781,18 @@ function createMultiTailwindcssPatcher(patchers) {
|
|
|
773
781
|
const [first] = patchers;
|
|
774
782
|
const multiPatcher = {
|
|
775
783
|
...first,
|
|
776
|
-
packageInfo: _optionalChain([first, 'optionalAccess',
|
|
777
|
-
majorVersion: _optionalChain([first, 'optionalAccess',
|
|
778
|
-
options: _optionalChain([first, 'optionalAccess',
|
|
784
|
+
packageInfo: _optionalChain([first, 'optionalAccess', _60 => _60.packageInfo]),
|
|
785
|
+
majorVersion: _optionalChain([first, 'optionalAccess', _61 => _61.majorVersion]),
|
|
786
|
+
options: _optionalChain([first, 'optionalAccess', _62 => _62.options]),
|
|
779
787
|
async patch() {
|
|
780
788
|
let exposeContext;
|
|
781
789
|
let extendLengthUnits;
|
|
782
790
|
for (const patcher of patchers) {
|
|
783
791
|
const result = await patcher.patch();
|
|
784
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
792
|
+
if (_optionalChain([result, 'optionalAccess', _63 => _63.exposeContext]) && exposeContext == null) {
|
|
785
793
|
exposeContext = result.exposeContext;
|
|
786
794
|
}
|
|
787
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
795
|
+
if (_optionalChain([result, 'optionalAccess', _64 => _64.extendLengthUnits]) && extendLengthUnits == null) {
|
|
788
796
|
extendLengthUnits = result.extendLengthUnits;
|
|
789
797
|
}
|
|
790
798
|
}
|
|
@@ -840,7 +848,7 @@ function createMultiTailwindcssPatcher(patchers) {
|
|
|
840
848
|
multiPatcher.getClassSetSync = () => {
|
|
841
849
|
const aggregated = /* @__PURE__ */ new Set();
|
|
842
850
|
for (const patcher of patchers) {
|
|
843
|
-
const current = _optionalChain([patcher, 'access',
|
|
851
|
+
const current = _optionalChain([patcher, 'access', _65 => _65.getClassSetSync, 'optionalCall', _66 => _66()]);
|
|
844
852
|
if (!current) {
|
|
845
853
|
continue;
|
|
846
854
|
}
|
|
@@ -919,7 +927,7 @@ function detectCallerBasedir() {
|
|
|
919
927
|
const lines = stack.split("\n");
|
|
920
928
|
for (const line of lines) {
|
|
921
929
|
const match = _nullishCoalesce(line.match(/\(([^)]+)\)/u), () => ( line.match(/at\s+(\S.*)$/u)));
|
|
922
|
-
const location = _optionalChain([match, 'optionalAccess',
|
|
930
|
+
const location = _optionalChain([match, 'optionalAccess', _67 => _67[1]]);
|
|
923
931
|
if (!location) {
|
|
924
932
|
continue;
|
|
925
933
|
}
|
|
@@ -949,8 +957,8 @@ function detectCallerBasedir() {
|
|
|
949
957
|
}
|
|
950
958
|
function resolveTailwindcssBasedir(basedir, fallback) {
|
|
951
959
|
const envBasedirResult = pickEnvBasedir();
|
|
952
|
-
const envBasedir = _optionalChain([envBasedirResult, 'optionalAccess',
|
|
953
|
-
const envBasedirKey = _optionalChain([envBasedirResult, 'optionalAccess',
|
|
960
|
+
const envBasedir = _optionalChain([envBasedirResult, 'optionalAccess', _68 => _68.value]);
|
|
961
|
+
const envBasedirKey = _optionalChain([envBasedirResult, 'optionalAccess', _69 => _69.key]);
|
|
954
962
|
const envBasedirIsGeneric = envBasedirKey ? GENERIC_ENV_BASEDIR_KEYS.has(envBasedirKey) : false;
|
|
955
963
|
const packageEnvBasedir = pickPackageEnvBasedir();
|
|
956
964
|
const shouldDetectCaller = !envBasedir || envBasedirIsGeneric;
|
|
@@ -1098,12 +1106,12 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
1098
1106
|
if (normalizedCssEntries) {
|
|
1099
1107
|
ctx.cssEntries = normalizedCssEntries;
|
|
1100
1108
|
}
|
|
1101
|
-
const shouldAttachBase = Boolean(ctx.tailwindcssBasedir && _optionalChain([normalizedCssEntries, 'optionalAccess',
|
|
1102
|
-
const tailwindcssWithBase = shouldAttachBase && _optionalChain([tailwindcss, 'optionalAccess',
|
|
1109
|
+
const shouldAttachBase = Boolean(ctx.tailwindcssBasedir && _optionalChain([normalizedCssEntries, 'optionalAccess', _70 => _70.length]));
|
|
1110
|
+
const tailwindcssWithBase = shouldAttachBase && _optionalChain([tailwindcss, 'optionalAccess', _71 => _71.v4]) !== null ? {
|
|
1103
1111
|
..._nullishCoalesce(tailwindcss, () => ( {})),
|
|
1104
1112
|
v4: {
|
|
1105
|
-
..._nullishCoalesce(_optionalChain([tailwindcss, 'optionalAccess',
|
|
1106
|
-
base: _nullishCoalesce(_optionalChain([tailwindcss, 'optionalAccess',
|
|
1113
|
+
..._nullishCoalesce(_optionalChain([tailwindcss, 'optionalAccess', _72 => _72.v4]), () => ( {})),
|
|
1114
|
+
base: _nullishCoalesce(_optionalChain([tailwindcss, 'optionalAccess', _73 => _73.v4, 'optionalAccess', _74 => _74.base]), () => ( resolvedTailwindcssBasedir))
|
|
1107
1115
|
}
|
|
1108
1116
|
} : tailwindcss;
|
|
1109
1117
|
const patcherOptions = {
|
|
@@ -1121,7 +1129,7 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
1121
1129
|
if (multiPatcher) {
|
|
1122
1130
|
return multiPatcher;
|
|
1123
1131
|
}
|
|
1124
|
-
if (_optionalChain([groupedCssEntries, 'optionalAccess',
|
|
1132
|
+
if (_optionalChain([groupedCssEntries, 'optionalAccess', _75 => _75.size]) === 1) {
|
|
1125
1133
|
const firstGroup = groupedCssEntries.entries().next().value;
|
|
1126
1134
|
if (firstGroup) {
|
|
1127
1135
|
const [baseDir, entries] = firstGroup;
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
var
|
|
3
|
+
var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -144,7 +144,7 @@ function rewriteTailwindcssRequestForCss(data, pkgDir, appType) {
|
|
|
144
144
|
if (!CSS_EXT_RE.test(normalizedIssuer)) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
const resolved =
|
|
147
|
+
const resolved = _chunk2WPTDMN3js.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
|
|
148
148
|
if (!resolved) {
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
@@ -154,8 +154,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
|
154
154
|
if (!options.enabled) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
158
|
-
factory.hooks.beforeResolve.tap(
|
|
157
|
+
compiler.hooks.normalModuleFactory.tap(_chunkXXJNXESJjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkXXJNXESJjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-G5OV7IOU.mjs";
|
|
16
16
|
import {
|
|
17
17
|
collectRuntimeClassSet,
|
|
18
18
|
createAttributeMatcher,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
replaceWxml,
|
|
24
24
|
toCustomAttributesEntities,
|
|
25
25
|
vitePluginName
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WGBJY2H3.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getGroupedEntries,
|
|
29
29
|
resolveUniUtsPlatform
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.4__@swc+core@1.15.7_@swc+h_4d5dc336679991eff78ae0f04625a6b1/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);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPatchTargetRecorder,
|
|
3
3
|
createTailwindPatchPromise
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WGBJY2H3.mjs";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZE7JKKFT.mjs";
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
@@ -9,27 +9,27 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDNRNFN4Ijs = require('./chunk-DNRNFN4I.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -38,11 +38,11 @@ var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
|
38
38
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
39
39
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
40
40
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
41
|
-
var debug =
|
|
42
|
-
var weappTailwindcssPackageDir =
|
|
41
|
+
var debug = _chunkXXJNXESJjs.createDebug.call(void 0, );
|
|
42
|
+
var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
43
43
|
var UnifiedWebpackPluginV5 = class {
|
|
44
44
|
constructor(options = {}) {
|
|
45
|
-
this.options =
|
|
45
|
+
this.options = _chunkXXJNXESJjs.getCompilerContext.call(void 0, options);
|
|
46
46
|
this.appType = this.options.appType;
|
|
47
47
|
}
|
|
48
48
|
apply(compiler) {
|
|
@@ -63,22 +63,22 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
63
63
|
twPatcher: initialTwPatcher,
|
|
64
64
|
refreshTailwindcssPatcher
|
|
65
65
|
} = this.options;
|
|
66
|
-
const disabledOptions =
|
|
66
|
+
const disabledOptions = _chunk2WPTDMN3js.resolveDisabledOptions.call(void 0, disabled);
|
|
67
67
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
68
68
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
69
|
-
const isMpxApp =
|
|
69
|
+
const isMpxApp = _chunkDNRNFN4Ijs.isMpx.call(void 0, this.appType);
|
|
70
70
|
if (shouldRewriteCssImports) {
|
|
71
|
-
|
|
71
|
+
_chunkDNRNFN4Ijs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
72
72
|
pkgDir: weappTailwindcssPackageDir,
|
|
73
73
|
enabled: true,
|
|
74
74
|
appType: this.appType
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
_chunkDNRNFN4Ijs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
77
77
|
}
|
|
78
78
|
if (disabledOptions.plugin) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const patchRecorderState =
|
|
81
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
82
82
|
source: "runtime",
|
|
83
83
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
84
84
|
});
|
|
@@ -89,14 +89,14 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
89
89
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
90
90
|
};
|
|
91
91
|
const refreshRuntimeState = async (force) => {
|
|
92
|
-
await
|
|
92
|
+
await _chunkXXJNXESJjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
93
93
|
};
|
|
94
94
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
95
95
|
const { ConcatSource } = sources;
|
|
96
96
|
async function getClassSetInLoader() {
|
|
97
97
|
await refreshRuntimeState(true);
|
|
98
98
|
await runtimeState.patchPromise;
|
|
99
|
-
await
|
|
99
|
+
await _chunkXXJNXESJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
100
100
|
}
|
|
101
101
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
102
102
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -109,16 +109,16 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
109
109
|
const classSetLoaderOptions = {
|
|
110
110
|
getClassSet: getClassSetInLoader
|
|
111
111
|
};
|
|
112
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
112
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkDNRNFN4Ijs.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
113
113
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
114
114
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
115
115
|
} : void 0;
|
|
116
116
|
onLoad();
|
|
117
117
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
118
|
-
|
|
118
|
+
_chunkDNRNFN4Ijs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
119
119
|
}
|
|
120
120
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
121
|
-
|
|
121
|
+
_chunkDNRNFN4Ijs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
122
122
|
}
|
|
123
123
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
124
124
|
loader: runtimeClassSetLoader,
|
|
@@ -137,17 +137,17 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
137
137
|
type: null
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
|
-
compiler.hooks.compilation.tap(
|
|
141
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
140
|
+
compiler.hooks.compilation.tap(_chunkXXJNXESJjs.pluginName, (compilation) => {
|
|
141
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkXXJNXESJjs.pluginName, (_loaderContext, module) => {
|
|
142
142
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
143
143
|
if (!hasRuntimeLoader) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
_chunkDNRNFN4Ijs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
|
|
147
147
|
const loaderEntries = module.loaders || [];
|
|
148
148
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
149
149
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
150
|
-
const isCssModule =
|
|
150
|
+
const isCssModule = _chunkDNRNFN4Ijs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
151
151
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
152
152
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
153
153
|
}
|
|
@@ -179,7 +179,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
179
179
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
if (runtimeClassSetLoaderExists && !
|
|
182
|
+
if (runtimeClassSetLoaderExists && !_chunkDNRNFN4Ijs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
183
183
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
184
184
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
185
185
|
if (anchorIndex === -1) {
|
|
@@ -192,7 +192,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
192
192
|
});
|
|
193
193
|
compilation.hooks.processAssets.tapPromise(
|
|
194
194
|
{
|
|
195
|
-
name:
|
|
195
|
+
name: _chunkXXJNXESJjs.pluginName,
|
|
196
196
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
197
197
|
},
|
|
198
198
|
async (assets) => {
|
|
@@ -210,13 +210,13 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
210
210
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
211
211
|
for (const [file] of entries) {
|
|
212
212
|
if (this.options.jsMatcher(file) || this.options.wxsMatcher(file)) {
|
|
213
|
-
const absolute =
|
|
213
|
+
const absolute = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
214
214
|
jsAssets.set(absolute, file);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
const moduleGraphOptions = {
|
|
218
218
|
resolve(specifier, importer) {
|
|
219
|
-
return
|
|
219
|
+
return _chunk2WPTDMN3js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
220
220
|
},
|
|
221
221
|
load: (id) => {
|
|
222
222
|
const assetName = jsAssets.get(id);
|
|
@@ -261,7 +261,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
261
261
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, this.options);
|
|
262
262
|
await refreshRuntimeState(true);
|
|
263
263
|
await runtimeState.patchPromise;
|
|
264
|
-
const runtimeSet = await
|
|
264
|
+
const runtimeSet = await _chunkXXJNXESJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
265
265
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
266
266
|
const tasks = [];
|
|
267
267
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -298,12 +298,12 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
298
298
|
const jsTaskFactories = [];
|
|
299
299
|
if (Array.isArray(groupedEntries.js)) {
|
|
300
300
|
for (const [file] of groupedEntries.js) {
|
|
301
|
-
const cacheKey =
|
|
301
|
+
const cacheKey = _chunkDNRNFN4Ijs.getCacheKey.call(void 0, file);
|
|
302
302
|
const asset = compilation.getAsset(file);
|
|
303
303
|
if (!asset) {
|
|
304
304
|
continue;
|
|
305
305
|
}
|
|
306
|
-
const absoluteFile =
|
|
306
|
+
const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
307
307
|
const initialSource = asset.source.source();
|
|
308
308
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
309
309
|
jsTaskFactories.push(async () => {
|
|
@@ -378,7 +378,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
378
378
|
);
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
_chunk2WPTDMN3js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
382
382
|
await Promise.all(tasks);
|
|
383
383
|
debug("end");
|
|
384
384
|
onEnd();
|