weapp-tailwindcss 4.8.9 → 4.8.11
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-ZTGB2D5W.js → chunk-22ETJBBT.js} +9 -8
- package/dist/{chunk-XQKBWIFI.js → chunk-2SG4SGMQ.js} +7 -7
- package/dist/{chunk-3BMQ6ZWL.mjs → chunk-3NLDVPXD.mjs} +2 -2
- package/dist/{chunk-S2YGU6BU.js → chunk-45BMEACS.js} +42 -20
- package/dist/{chunk-Z366CKKB.js → chunk-6LNKARWD.js} +28 -28
- package/dist/{chunk-FYYIFZ36.mjs → chunk-BSGZZCLH.mjs} +4 -3
- package/dist/{chunk-M4NERJO7.js → chunk-CFFV3OIP.js} +1 -1
- package/dist/{chunk-PBUQRF6F.js → chunk-DLSEDDLQ.js} +22 -22
- package/dist/{chunk-4KBHUV2C.js → chunk-FAKEMDGU.js} +6 -6
- package/dist/{chunk-6OE4Q2BC.mjs → chunk-FGNKGESE.mjs} +4 -4
- package/dist/{chunk-6UW6DOPI.js → chunk-FM3FLOYY.js} +5 -5
- package/dist/{chunk-IXK4ZWFR.mjs → chunk-HHSKDU3Z.mjs} +28 -6
- package/dist/{chunk-5ROWVF7O.mjs → chunk-LAVN5SDT.mjs} +2 -2
- package/dist/{chunk-3IP5JCFZ.mjs → chunk-SXBK4NF4.mjs} +1 -1
- package/dist/{chunk-H6YMPVI6.mjs → chunk-TWF4BQKE.mjs} +2 -2
- package/dist/{chunk-AGWNHP3C.mjs → chunk-W6ASDRWZ.mjs} +1 -1
- package/dist/{chunk-J25ZFRYM.js → chunk-YXT3T3LH.js} +2 -2
- package/dist/cli.js +140 -58
- package/dist/cli.mjs +97 -15
- 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 +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 +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 +6 -5
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk45BMEACSjs = require('./chunk-45BMEACS.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunk3URI7W6Xjs = require('./chunk-3URI7W6X.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.8.
|
|
190
|
+
version: "4.8.11",
|
|
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",
|
|
@@ -355,6 +355,7 @@ var package_default = {
|
|
|
355
355
|
test: "npm run postinstall && vitest run",
|
|
356
356
|
"test:dev": "vitest",
|
|
357
357
|
"test:ui": "vitest --ui",
|
|
358
|
+
bench: "vitest bench --config ./vitest.config.ts",
|
|
358
359
|
"bench:js-handlers": "tsx scripts/js-bench.ts",
|
|
359
360
|
"bench:js-diff": "tsx scripts/js-bench-diff.ts",
|
|
360
361
|
clean: "tsx scripts/clean.ts",
|
|
@@ -379,7 +380,7 @@ var package_default = {
|
|
|
379
380
|
"@tailwindcss-mangle/config": "^6.1.0",
|
|
380
381
|
"@vue/compiler-dom": "catalog:vue3",
|
|
381
382
|
"@vue/compiler-sfc": "catalog:vue3",
|
|
382
|
-
"@weapp-core/escape": "~
|
|
383
|
+
"@weapp-core/escape": "~6.0.1",
|
|
383
384
|
"@weapp-core/regex": "~1.0.1",
|
|
384
385
|
"@weapp-tailwindcss/logger": "workspace:*",
|
|
385
386
|
"@weapp-tailwindcss/postcss": "workspace:*",
|
|
@@ -440,7 +441,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
440
441
|
}
|
|
441
442
|
function resolveRecordLocation(baseDir) {
|
|
442
443
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
443
|
-
const packageRoot = _nullishCoalesce(
|
|
444
|
+
const packageRoot = _nullishCoalesce(_chunk45BMEACSjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
444
445
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
445
446
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
446
447
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -2770,15 +2771,15 @@ function createInternalCompilerContext(opts) {
|
|
|
2770
2771
|
);
|
|
2771
2772
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2772
2773
|
applyLoggerLevel(ctx.logLevel);
|
|
2773
|
-
const twPatcher =
|
|
2774
|
+
const twPatcher = _chunk45BMEACSjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2774
2775
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
2775
2776
|
if (_optionalChain([twPatcher, 'access', _95 => _95.packageInfo, 'optionalAccess', _96 => _96.version])) {
|
|
2776
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)))}`);
|
|
2777
2778
|
} else {
|
|
2778
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`);
|
|
2779
2780
|
}
|
|
2780
|
-
|
|
2781
|
-
const cssCalcOptions =
|
|
2781
|
+
_chunk45BMEACSjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2782
|
+
const cssCalcOptions = _chunk45BMEACSjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
2782
2783
|
ctx.cssCalc = cssCalcOptions;
|
|
2783
2784
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
2784
2785
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -2797,7 +2798,7 @@ function createInternalCompilerContext(opts) {
|
|
|
2797
2798
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2798
2799
|
}
|
|
2799
2800
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2800
|
-
const nextPatcher =
|
|
2801
|
+
const nextPatcher = _chunk45BMEACSjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2801
2802
|
Object.assign(previousPatcher, nextPatcher);
|
|
2802
2803
|
ctx.twPatcher = previousPatcher;
|
|
2803
2804
|
return previousPatcher;
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFM3FLOYYjs = require('./chunk-FM3FLOYY.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk22ETJBBTjs = require('./chunk-22ETJBBT.js');
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
var _buffer = require('buffer');
|
|
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
17
17
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
18
18
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
19
19
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
20
|
-
var debug =
|
|
20
|
+
var debug = _chunk22ETJBBTjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunk22ETJBBTjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunkFM3FLOYYjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
26
26
|
source: "runtime",
|
|
27
27
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
28
28
|
});
|
|
@@ -36,7 +36,7 @@ function createPlugins(options = {}) {
|
|
|
36
36
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
37
37
|
let runtimeSetInitialized = false;
|
|
38
38
|
async function refreshRuntimeState(force) {
|
|
39
|
-
await
|
|
39
|
+
await _chunk22ETJBBTjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
40
40
|
}
|
|
41
41
|
async function refreshRuntimeSet(force = false) {
|
|
42
42
|
await refreshRuntimeState(force);
|
|
@@ -44,7 +44,7 @@ function createPlugins(options = {}) {
|
|
|
44
44
|
if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
|
|
45
45
|
return runtimeSet;
|
|
46
46
|
}
|
|
47
|
-
runtimeSet = await
|
|
47
|
+
runtimeSet = await _chunk22ETJBBTjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPatchTargetRecorder,
|
|
3
3
|
createTailwindPatchPromise
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BSGZZCLH.mjs";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HHSKDU3Z.mjs";
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCFFV3OIPjs = require('./chunk-CFFV3OIP.js');
|
|
7
7
|
|
|
8
8
|
// src/context/tailwindcss.ts
|
|
9
9
|
var _fs = require('fs');
|
|
@@ -239,7 +239,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
239
239
|
return void 0;
|
|
240
240
|
}
|
|
241
241
|
try {
|
|
242
|
-
const req = _module.createRequire.call(void 0,
|
|
242
|
+
const req = _module.createRequire.call(void 0, _chunkCFFV3OIPjs.importMetaUrl);
|
|
243
243
|
return req.resolve(specifier, { paths });
|
|
244
244
|
} catch (e3) {
|
|
245
245
|
return void 0;
|
|
@@ -339,11 +339,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
339
339
|
const cwd = _process2.default.cwd();
|
|
340
340
|
appendNodeModules(paths, cwd);
|
|
341
341
|
try {
|
|
342
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
342
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkCFFV3OIPjs.importMetaUrl);
|
|
343
343
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
344
344
|
paths.add(candidate);
|
|
345
345
|
} catch (e4) {
|
|
346
|
-
paths.add(
|
|
346
|
+
paths.add(_chunkCFFV3OIPjs.importMetaUrl);
|
|
347
347
|
}
|
|
348
348
|
if (paths.size === 0) {
|
|
349
349
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -448,7 +448,7 @@ function createTailwindcssPatcher(options) {
|
|
|
448
448
|
}
|
|
449
449
|
const resolvePaths = createDefaultResolvePaths(_nullishCoalesce(_nullishCoalesce(cache.cwd, () => ( normalizedBasedir)), () => ( _process2.default.cwd())));
|
|
450
450
|
const normalizedUserOptions = normalizeTailwindcssPatcherOptions(tailwindcssPatcherOptions);
|
|
451
|
-
const extendLengthUnits = normalizeExtendLengthUnits(supportCustomLengthUnitsPatch);
|
|
451
|
+
const extendLengthUnits = normalizeExtendLengthUnits(_nullishCoalesce(supportCustomLengthUnitsPatch, () => ( true)));
|
|
452
452
|
const baseTailwindOptions = _shared.defuOverrideArray.call(void 0,
|
|
453
453
|
_nullishCoalesce(tailwindcss, () => ( {})),
|
|
454
454
|
{
|
|
@@ -733,12 +733,34 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
733
733
|
baseDir,
|
|
734
734
|
_nullishCoalesce(cssEntries, () => ( []))
|
|
735
735
|
);
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
tailwindcss
|
|
740
|
-
|
|
736
|
+
const configuredPackageName = _optionalChain([tailwindcss, 'optionalAccess', _42 => _42.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _43 => _43.tailwind, 'optionalAccess', _44 => _44.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _45 => _45.patch, 'optionalAccess', _46 => _46.tailwindcss, 'optionalAccess', _47 => _47.packageName]);
|
|
737
|
+
const configuredVersion = _optionalChain([tailwindcss, 'optionalAccess', _48 => _48.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _49 => _49.tailwind, 'optionalAccess', _50 => _50.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _51 => _51.patch, 'optionalAccess', _52 => _52.tailwindcss, 'optionalAccess', _53 => _53.version]) || mergedTailwindOptions.version;
|
|
738
|
+
const isTailwindcss4Package = (packageName) => Boolean(
|
|
739
|
+
packageName && (packageName === "tailwindcss4" || packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4"))
|
|
740
|
+
);
|
|
741
|
+
const isV4 = configuredVersion === 4 || mergedTailwindOptions.version === 4 || isTailwindcss4Package(_nullishCoalesce(configuredPackageName, () => ( mergedTailwindOptions.packageName)));
|
|
742
|
+
const tailwindPackageConfigured = Boolean(configuredPackageName);
|
|
743
|
+
const shouldPatchV4PostcssPackage = isV4 && !tailwindPackageConfigured;
|
|
744
|
+
const packageCandidates = /* @__PURE__ */ new Set();
|
|
745
|
+
if (shouldPatchV4PostcssPackage) {
|
|
746
|
+
packageCandidates.add("@tailwindcss/postcss");
|
|
747
|
+
}
|
|
748
|
+
packageCandidates.add(
|
|
749
|
+
_nullishCoalesce(_nullishCoalesce(mergedTailwindOptions.packageName, () => ( configuredPackageName)), () => ( "tailwindcss"))
|
|
750
|
+
);
|
|
751
|
+
const patchers = Array.from(packageCandidates).map((packageName) => {
|
|
752
|
+
const tailwindOptionsForPackage = {
|
|
753
|
+
...mergedTailwindOptions,
|
|
754
|
+
packageName
|
|
755
|
+
};
|
|
756
|
+
return createTailwindcssPatcher({
|
|
757
|
+
basedir: baseDir,
|
|
758
|
+
supportCustomLengthUnitsPatch: _nullishCoalesce(supportCustomLengthUnitsPatch, () => ( true)),
|
|
759
|
+
tailwindcss: tailwindOptionsForPackage,
|
|
760
|
+
tailwindcssPatcherOptions: patchedOptions
|
|
761
|
+
});
|
|
741
762
|
});
|
|
763
|
+
return patchers.length === 1 ? patchers[0] : createMultiTailwindcssPatcher(patchers);
|
|
742
764
|
}
|
|
743
765
|
function createMultiTailwindcssPatcher(patchers) {
|
|
744
766
|
if (patchers.length <= 1) {
|
|
@@ -746,18 +768,18 @@ function createMultiTailwindcssPatcher(patchers) {
|
|
|
746
768
|
}
|
|
747
769
|
const [first] = patchers;
|
|
748
770
|
const multiPatcher = {
|
|
749
|
-
packageInfo: _optionalChain([first, 'optionalAccess',
|
|
750
|
-
majorVersion: _optionalChain([first, 'optionalAccess',
|
|
751
|
-
options: _optionalChain([first, 'optionalAccess',
|
|
771
|
+
packageInfo: _optionalChain([first, 'optionalAccess', _54 => _54.packageInfo]),
|
|
772
|
+
majorVersion: _optionalChain([first, 'optionalAccess', _55 => _55.majorVersion]),
|
|
773
|
+
options: _optionalChain([first, 'optionalAccess', _56 => _56.options]),
|
|
752
774
|
async patch() {
|
|
753
775
|
let exposeContext;
|
|
754
776
|
let extendLengthUnits;
|
|
755
777
|
for (const patcher of patchers) {
|
|
756
778
|
const result = await patcher.patch();
|
|
757
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
779
|
+
if (_optionalChain([result, 'optionalAccess', _57 => _57.exposeContext]) && exposeContext == null) {
|
|
758
780
|
exposeContext = result.exposeContext;
|
|
759
781
|
}
|
|
760
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
782
|
+
if (_optionalChain([result, 'optionalAccess', _58 => _58.extendLengthUnits]) && extendLengthUnits == null) {
|
|
761
783
|
extendLengthUnits = result.extendLengthUnits;
|
|
762
784
|
}
|
|
763
785
|
}
|
|
@@ -813,7 +835,7 @@ function createMultiTailwindcssPatcher(patchers) {
|
|
|
813
835
|
multiPatcher.getClassSetSync = () => {
|
|
814
836
|
const aggregated = /* @__PURE__ */ new Set();
|
|
815
837
|
for (const patcher of patchers) {
|
|
816
|
-
const current = _optionalChain([patcher, 'access',
|
|
838
|
+
const current = _optionalChain([patcher, 'access', _59 => _59.getClassSetSync, 'optionalCall', _60 => _60()]);
|
|
817
839
|
if (!current) {
|
|
818
840
|
continue;
|
|
819
841
|
}
|
|
@@ -886,7 +908,7 @@ function detectCallerBasedir() {
|
|
|
886
908
|
const lines = stack.split("\n");
|
|
887
909
|
for (const line of lines) {
|
|
888
910
|
const match = _nullishCoalesce(line.match(/\(([^)]+)\)/u), () => ( line.match(/at\s+(\S.*)$/u)));
|
|
889
|
-
const location = _optionalChain([match, 'optionalAccess',
|
|
911
|
+
const location = _optionalChain([match, 'optionalAccess', _61 => _61[1]]);
|
|
890
912
|
if (!location) {
|
|
891
913
|
continue;
|
|
892
914
|
}
|
|
@@ -916,8 +938,8 @@ function detectCallerBasedir() {
|
|
|
916
938
|
}
|
|
917
939
|
function resolveTailwindcssBasedir(basedir, fallback) {
|
|
918
940
|
const envBasedirResult = pickEnvBasedir();
|
|
919
|
-
const envBasedir = _optionalChain([envBasedirResult, 'optionalAccess',
|
|
920
|
-
const envBasedirKey = _optionalChain([envBasedirResult, 'optionalAccess',
|
|
941
|
+
const envBasedir = _optionalChain([envBasedirResult, 'optionalAccess', _62 => _62.value]);
|
|
942
|
+
const envBasedirKey = _optionalChain([envBasedirResult, 'optionalAccess', _63 => _63.key]);
|
|
921
943
|
const envBasedirIsGeneric = envBasedirKey ? GENERIC_ENV_BASEDIR_KEYS.has(envBasedirKey) : false;
|
|
922
944
|
const packageEnvBasedir = pickPackageEnvBasedir();
|
|
923
945
|
const shouldDetectCaller = !envBasedir || envBasedirIsGeneric;
|
|
@@ -1080,7 +1102,7 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
1080
1102
|
if (multiPatcher) {
|
|
1081
1103
|
return multiPatcher;
|
|
1082
1104
|
}
|
|
1083
|
-
if (_optionalChain([groupedCssEntries, 'optionalAccess',
|
|
1105
|
+
if (_optionalChain([groupedCssEntries, 'optionalAccess', _64 => _64.size]) === 1) {
|
|
1084
1106
|
const firstGroup = groupedCssEntries.entries().next().value;
|
|
1085
1107
|
if (firstGroup) {
|
|
1086
1108
|
const [baseDir, entries] = firstGroup;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkFAKEMDGUjs = require('./chunk-FAKEMDGU.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -15,20 +15,20 @@ var _chunk4KBHUV2Cjs = require('./chunk-4KBHUV2C.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkYXT3T3LHjs = require('./chunk-YXT3T3LH.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkFM3FLOYYjs = require('./chunk-FM3FLOYY.js');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunk22ETJBBTjs = require('./chunk-22ETJBBT.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 = _chunk22ETJBBTjs.createDebug.call(void 0, );
|
|
41
|
+
var weappTailwindcssPackageDir = _chunkYXT3T3LHjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
42
42
|
var UnifiedWebpackPluginV5 = class {
|
|
43
43
|
constructor(options = {}) {
|
|
44
|
-
this.options =
|
|
44
|
+
this.options = _chunk22ETJBBTjs.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 = _chunkYXT3T3LHjs.isMpx.call(void 0, this.appType);
|
|
71
71
|
if (shouldRewriteCssImports) {
|
|
72
|
-
|
|
72
|
+
_chunkFAKEMDGUjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
73
73
|
pkgDir: weappTailwindcssPackageDir,
|
|
74
74
|
enabled: true,
|
|
75
75
|
appType: this.appType
|
|
76
76
|
});
|
|
77
|
-
|
|
77
|
+
_chunkYXT3T3LHjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
78
78
|
}
|
|
79
|
-
const patchRecorderState =
|
|
79
|
+
const patchRecorderState = _chunkFM3FLOYYjs.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 _chunk22ETJBBTjs.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 _chunk22ETJBBTjs.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 } = _chunkFAKEMDGUjs.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
|
+
_chunkYXT3T3LHjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
117
117
|
}
|
|
118
118
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
119
|
-
|
|
119
|
+
_chunkYXT3T3LHjs.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(_chunk22ETJBBTjs.pluginName, (compilation) => {
|
|
139
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunk22ETJBBTjs.pluginName, (_loaderContext, module) => {
|
|
140
140
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
141
141
|
if (!hasRuntimeLoader) {
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
_chunkYXT3T3LHjs.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 = _chunkFAKEMDGUjs.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 && !_chunkFAKEMDGUjs.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: _chunk22ETJBBTjs.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 = _chunkYXT3T3LHjs.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 _chunkYXT3T3LHjs.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 _chunk22ETJBBTjs.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 = _chunkFAKEMDGUjs.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 = _chunkYXT3T3LHjs.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
|
+
_chunkYXT3T3LHjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
380
380
|
await Promise.all(tasks);
|
|
381
381
|
debug("end");
|
|
382
382
|
onEnd();
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createTailwindcssPatcherFromContext,
|
|
4
4
|
findNearestPackageRoot,
|
|
5
5
|
warnMissingCssEntries
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HHSKDU3Z.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getDefaultOptions
|
|
9
9
|
} from "./chunk-QF65JGNW.mjs";
|
|
@@ -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.8.
|
|
190
|
+
version: "4.8.11",
|
|
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",
|
|
@@ -355,6 +355,7 @@ var package_default = {
|
|
|
355
355
|
test: "npm run postinstall && vitest run",
|
|
356
356
|
"test:dev": "vitest",
|
|
357
357
|
"test:ui": "vitest --ui",
|
|
358
|
+
bench: "vitest bench --config ./vitest.config.ts",
|
|
358
359
|
"bench:js-handlers": "tsx scripts/js-bench.ts",
|
|
359
360
|
"bench:js-diff": "tsx scripts/js-bench-diff.ts",
|
|
360
361
|
clean: "tsx scripts/clean.ts",
|
|
@@ -379,7 +380,7 @@ var package_default = {
|
|
|
379
380
|
"@tailwindcss-mangle/config": "^6.1.0",
|
|
380
381
|
"@vue/compiler-dom": "catalog:vue3",
|
|
381
382
|
"@vue/compiler-sfc": "catalog:vue3",
|
|
382
|
-
"@weapp-core/escape": "~
|
|
383
|
+
"@weapp-core/escape": "~6.0.1",
|
|
383
384
|
"@weapp-core/regex": "~1.0.1",
|
|
384
385
|
"@weapp-tailwindcss/logger": "workspace:*",
|
|
385
386
|
"@weapp-tailwindcss/postcss": "workspace:*",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../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/cjs_shims.js
|
|
2
2
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
3
3
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
4
4
|
|