weapp-tailwindcss 4.9.2-alpha.1 → 4.9.2-alpha.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-ORSWL3MI.js → chunk-2WPTDMN3.js} +2 -2
- package/dist/{chunk-Y4A76SWP.js → chunk-5O6237HX.js} +37 -29
- package/dist/{chunk-OU6P3233.mjs → chunk-6HBFEXOW.mjs} +2 -2
- package/dist/{chunk-FAUL26KB.mjs → chunk-CF7VDUIE.mjs} +4 -4
- package/dist/{chunk-SM5V25IN.mjs → chunk-FFGR5V3H.mjs} +1 -1
- package/dist/{chunk-D2ZOXBOU.js → chunk-J7KULRTR.js} +7 -7
- package/dist/{chunk-W3Z55EVM.mjs → chunk-JOLM54PI.mjs} +2 -2
- package/dist/{chunk-2QR4UOHA.js → chunk-KA2JONAP.js} +5 -5
- package/dist/{chunk-IC2XBOKV.js → chunk-NGRAUBWU.js} +23 -23
- package/dist/{chunk-O2XZFBRS.js → chunk-OGG7WXHZ.js} +29 -29
- package/dist/{chunk-IK5SFZ6A.mjs → chunk-OU2OBBPZ.mjs} +2 -2
- package/dist/{chunk-VZLUWOGQ.mjs → chunk-QA5NZSGN.mjs} +1 -1
- package/dist/{chunk-MB4BR57E.js → chunk-UAEME5HT.js} +1 -1
- package/dist/{chunk-EOCBETCN.js → chunk-W4XFWZB5.js} +5 -5
- package/dist/{chunk-GKFJPK5V.mjs → chunk-XWGIWOHV.mjs} +2 -2
- package/dist/{chunk-HNNJH4ZX.js → chunk-YBTRKOE2.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
|
@@ -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);
|
|
@@ -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;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XWGIWOHV.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-OU2OBBPZ.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getGroupedEntries,
|
|
29
29
|
resolveUniUtsPlatform
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QA5NZSGN.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-XWGIWOHV.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-OU2OBBPZ.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";
|
|
@@ -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);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkFYYBY3VKjs = require('./chunk-FYYBY3VK.js');
|
|
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
187
187
|
// package.json
|
|
188
188
|
var package_default = {
|
|
189
189
|
name: "weapp-tailwindcss",
|
|
190
|
-
version: "4.9.2-alpha.
|
|
190
|
+
version: "4.9.2-alpha.2",
|
|
191
191
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
192
192
|
author: "ice breaker <1324318532@qq.com>",
|
|
193
193
|
license: "MIT",
|
|
@@ -543,7 +543,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
543
543
|
}
|
|
544
544
|
function resolveRecordLocation(baseDir) {
|
|
545
545
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
546
|
-
const packageRoot = _nullishCoalesce(
|
|
546
|
+
const packageRoot = _nullishCoalesce(_chunk5O6237HXjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
547
547
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
548
548
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
549
549
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -2771,15 +2771,15 @@ function createInternalCompilerContext(opts) {
|
|
|
2771
2771
|
);
|
|
2772
2772
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2773
2773
|
applyLoggerLevel(ctx.logLevel);
|
|
2774
|
-
const twPatcher =
|
|
2774
|
+
const twPatcher = _chunk5O6237HXjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2775
2775
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
2776
2776
|
if (_optionalChain([twPatcher, 'access', _95 => _95.packageInfo, 'optionalAccess', _96 => _96.version])) {
|
|
2777
2777
|
_logger.logger.success(`\u5F53\u524D\u4F7F\u7528 ${_logger.pc.cyanBright("Tailwind CSS")} \u7248\u672C\u4E3A: ${_logger.pc.underline(_logger.pc.bold(_logger.pc.green(twPatcher.packageInfo.version)))}`);
|
|
2778
2778
|
} else {
|
|
2779
2779
|
_logger.logger.warn(`${_logger.pc.cyanBright("Tailwind CSS")} \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7\u7248\u672C\u68C0\u6D4B\u4E0E\u8865\u4E01\u5E94\u7528\u3002`);
|
|
2780
2780
|
}
|
|
2781
|
-
|
|
2782
|
-
const cssCalcOptions =
|
|
2781
|
+
_chunk5O6237HXjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2782
|
+
const cssCalcOptions = _chunk5O6237HXjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
2783
2783
|
ctx.cssCalc = cssCalcOptions;
|
|
2784
2784
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
2785
2785
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -2798,7 +2798,7 @@ function createInternalCompilerContext(opts) {
|
|
|
2798
2798
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2799
2799
|
}
|
|
2800
2800
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2801
|
-
const nextPatcher =
|
|
2801
|
+
const nextPatcher = _chunk5O6237HXjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2802
2802
|
Object.assign(previousPatcher, nextPatcher);
|
|
2803
2803
|
ctx.twPatcher = previousPatcher;
|
|
2804
2804
|
return previousPatcher;
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XWGIWOHV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OU2OBBPZ.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -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 _chunkJ7KULRTRjs = require('./chunk-J7KULRTR.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkJ7KULRTRjs.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
|
+
_chunk5O6237HXjs.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 ? _chunkJ7KULRTRjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkKA2JONAPjs = require('./chunk-KA2JONAP.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ var _chunk2QR4UOHAjs = require('./chunk-2QR4UOHA.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkJ7KULRTRjs = require('./chunk-J7KULRTR.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -56,7 +56,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
56
56
|
const start = prop.value.loc.start.offset + 1;
|
|
57
57
|
const end = prop.value.loc.end.offset - 1;
|
|
58
58
|
if (start < end) {
|
|
59
|
-
ms.update(start, end,
|
|
59
|
+
ms.update(start, end, _chunkJ7KULRTRjs.replaceWxml.call(void 0, prop.value.content));
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -68,7 +68,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
68
68
|
if (start >= end) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const generated =
|
|
71
|
+
const generated = _chunkJ7KULRTRjs.generateCode.call(void 0, prop.exp.content, {
|
|
72
72
|
jsHandler,
|
|
73
73
|
runtimeSet,
|
|
74
74
|
wrapExpression: true
|
|
@@ -97,7 +97,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
100
|
-
const matchCustomAttribute =
|
|
100
|
+
const matchCustomAttribute = _chunkJ7KULRTRjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
101
101
|
const ms = new (0, _magicstring2.default)(code);
|
|
102
102
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
103
103
|
if (errors.length === 0) {
|
|
@@ -364,7 +364,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
364
364
|
runtimeSet,
|
|
365
365
|
applyLinkedResults: applyLinkedResults2
|
|
366
366
|
} = options;
|
|
367
|
-
const absoluteFile =
|
|
367
|
+
const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
368
368
|
const rawSource = originalSource.source.toString();
|
|
369
369
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
370
370
|
cache,
|
|
@@ -399,8 +399,8 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
// src/bundlers/vite/index.ts
|
|
402
|
-
var debug =
|
|
403
|
-
var weappTailwindcssPackageDir =
|
|
402
|
+
var debug = _chunkJ7KULRTRjs.createDebug.call(void 0, );
|
|
403
|
+
var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
404
404
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
405
405
|
function joinPosixPath(base, subpath) {
|
|
406
406
|
if (base.endsWith("/")) {
|
|
@@ -444,7 +444,7 @@ function isJavaScriptEntry(entry) {
|
|
|
444
444
|
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
445
445
|
return {
|
|
446
446
|
resolve(specifier, importer) {
|
|
447
|
-
return
|
|
447
|
+
return _chunk2WPTDMN3js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
|
|
448
448
|
},
|
|
449
449
|
load(id) {
|
|
450
450
|
const entry = entries.get(id);
|
|
@@ -482,7 +482,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
482
482
|
}
|
|
483
483
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
484
484
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
485
|
-
const opts =
|
|
485
|
+
const opts = _chunkJ7KULRTRjs.getCompilerContext.call(void 0, options);
|
|
486
486
|
const {
|
|
487
487
|
disabled,
|
|
488
488
|
customAttributes,
|
|
@@ -501,17 +501,17 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
501
501
|
uniAppX,
|
|
502
502
|
disabledDefaultTemplateHandler
|
|
503
503
|
} = opts;
|
|
504
|
-
const disabledOptions =
|
|
504
|
+
const disabledOptions = _chunk2WPTDMN3js.resolveDisabledOptions.call(void 0, disabled);
|
|
505
505
|
const tailwindcssMajorVersion = _nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0));
|
|
506
506
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
507
507
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
508
508
|
{
|
|
509
|
-
name: `${
|
|
509
|
+
name: `${_chunkJ7KULRTRjs.vitePluginName}:rewrite-css-imports`,
|
|
510
510
|
enforce: "pre",
|
|
511
511
|
resolveId: {
|
|
512
512
|
order: "pre",
|
|
513
513
|
handler(id, importer) {
|
|
514
|
-
const replacement =
|
|
514
|
+
const replacement = _chunk2WPTDMN3js.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
|
|
515
515
|
join: joinPosixPath,
|
|
516
516
|
appType
|
|
517
517
|
});
|
|
@@ -530,7 +530,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
530
530
|
if (!isCSSRequest(id)) {
|
|
531
531
|
return null;
|
|
532
532
|
}
|
|
533
|
-
const rewritten =
|
|
533
|
+
const rewritten = _chunk2WPTDMN3js.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
|
|
534
534
|
join: joinPosixPath,
|
|
535
535
|
appType
|
|
536
536
|
});
|
|
@@ -548,8 +548,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
548
548
|
if (disabledOptions.plugin) {
|
|
549
549
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
550
550
|
}
|
|
551
|
-
const customAttributesEntities =
|
|
552
|
-
const patchRecorderState =
|
|
551
|
+
const customAttributesEntities = _chunkJ7KULRTRjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
552
|
+
const patchRecorderState = _chunkKA2JONAPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
553
553
|
source: "runtime",
|
|
554
554
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
555
555
|
});
|
|
@@ -563,7 +563,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
563
563
|
let runtimeSetPromise;
|
|
564
564
|
let resolvedConfig;
|
|
565
565
|
async function refreshRuntimeState(force) {
|
|
566
|
-
const refreshed = await
|
|
566
|
+
const refreshed = await _chunkJ7KULRTRjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
567
567
|
if (refreshed) {
|
|
568
568
|
runtimeSet = void 0;
|
|
569
569
|
runtimeSetPromise = void 0;
|
|
@@ -576,7 +576,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
576
576
|
return runtimeSet;
|
|
577
577
|
}
|
|
578
578
|
if (force || !runtimeSetPromise) {
|
|
579
|
-
const task2 =
|
|
579
|
+
const task2 = _chunkJ7KULRTRjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
580
580
|
force: force || !runtimeSet,
|
|
581
581
|
skipRefresh: force
|
|
582
582
|
});
|
|
@@ -611,7 +611,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
611
611
|
const plugins = [
|
|
612
612
|
...rewritePlugins,
|
|
613
613
|
{
|
|
614
|
-
name: `${
|
|
614
|
+
name: `${_chunkJ7KULRTRjs.vitePluginName}:post`,
|
|
615
615
|
enforce: "post",
|
|
616
616
|
configResolved(config) {
|
|
617
617
|
resolvedConfig = config;
|
|
@@ -637,7 +637,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
637
637
|
for (const [fileName, output] of entries) {
|
|
638
638
|
const entry = { fileName, output };
|
|
639
639
|
if (isJavaScriptEntry(entry)) {
|
|
640
|
-
const absolute =
|
|
640
|
+
const absolute = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, fileName, outDir);
|
|
641
641
|
jsEntries.set(absolute, entry);
|
|
642
642
|
}
|
|
643
643
|
}
|
|
@@ -704,7 +704,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
704
704
|
if (Array.isArray(groupedEntries.js)) {
|
|
705
705
|
for (const [file, originalSource] of groupedEntries.js) {
|
|
706
706
|
if (originalSource.type === "chunk") {
|
|
707
|
-
const absoluteFile =
|
|
707
|
+
const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
708
708
|
const initialRawSource = originalSource.code;
|
|
709
709
|
jsTaskFactories.push(async () => {
|
|
710
710
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
@@ -785,7 +785,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
785
785
|
);
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
|
-
|
|
788
|
+
_chunk2WPTDMN3js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
789
789
|
await Promise.all(tasks);
|
|
790
790
|
for (const apply of pendingLinkedUpdates) {
|
|
791
791
|
apply();
|