weapp-tailwindcss 4.8.9 → 4.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6OE4Q2BC.mjs → chunk-B7QESXH4.mjs} +4 -4
- package/dist/{chunk-5ROWVF7O.mjs → chunk-BZXRUB2B.mjs} +2 -2
- package/dist/{chunk-M4NERJO7.js → chunk-CFFV3OIP.js} +1 -1
- package/dist/{chunk-H6YMPVI6.mjs → chunk-HFAC5AYM.mjs} +2 -2
- package/dist/{chunk-4KBHUV2C.js → chunk-INF2Q5LI.js} +6 -6
- package/dist/{chunk-FYYIFZ36.mjs → chunk-JCG2LT63.mjs} +3 -2
- package/dist/{chunk-ZTGB2D5W.js → chunk-MNZW5VG5.js} +9 -8
- package/dist/{chunk-PBUQRF6F.js → chunk-OACITA4W.js} +22 -22
- package/dist/{chunk-3BMQ6ZWL.mjs → chunk-OBOKBKZQ.mjs} +1 -1
- package/dist/{chunk-3IP5JCFZ.mjs → chunk-SXBK4NF4.mjs} +1 -1
- package/dist/{chunk-Z366CKKB.js → chunk-VMX23GDK.js} +28 -28
- package/dist/{chunk-S2YGU6BU.js → chunk-W7H4R6CP.js} +4 -4
- package/dist/{chunk-6UW6DOPI.js → chunk-XP5623NL.js} +5 -5
- package/dist/{chunk-AGWNHP3C.mjs → chunk-XXO2FHP7.mjs} +1 -1
- package/dist/{chunk-XQKBWIFI.js → chunk-YM3HBJ3Q.js} +7 -7
- package/dist/{chunk-J25ZFRYM.js → chunk-YXT3T3LH.js} +2 -2
- package/dist/cli.js +29 -29
- package/dist/cli.mjs +2 -2
- package/dist/core.js +10 -10
- package/dist/core.mjs +3 -3
- 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 +4 -4
- package/dist/index.js +10 -10
- package/dist/index.mjs +7 -7
- 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 +1 -1
- 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 +4 -4
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.js +31 -31
- package/dist/webpack4.mjs +4 -4
- package/package.json +6 -5
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getCacheKey,
|
|
5
5
|
hasLoaderEntry,
|
|
6
6
|
isCssLikeModuleResource
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XXO2FHP7.mjs";
|
|
8
8
|
import {
|
|
9
9
|
ensureMpxTailwindcssAliases,
|
|
10
10
|
injectMpxCssRewritePreRules,
|
|
@@ -21,20 +21,20 @@ import {
|
|
|
21
21
|
} from "./chunk-RRHPTTCP.mjs";
|
|
22
22
|
import {
|
|
23
23
|
setupPatchRecorder
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-OBOKBKZQ.mjs";
|
|
25
25
|
import {
|
|
26
26
|
collectRuntimeClassSet,
|
|
27
27
|
createDebug,
|
|
28
28
|
getCompilerContext,
|
|
29
29
|
pluginName,
|
|
30
30
|
refreshTailwindRuntimeState
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JCG2LT63.mjs";
|
|
32
32
|
import {
|
|
33
33
|
getGroupedEntries
|
|
34
34
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
35
35
|
import {
|
|
36
36
|
__dirname
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SXBK4NF4.mjs";
|
|
38
38
|
|
|
39
39
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
40
40
|
import fs from "fs";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-RRHPTTCP.mjs";
|
|
12
12
|
import {
|
|
13
13
|
setupPatchRecorder
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OBOKBKZQ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
collectRuntimeClassSet,
|
|
17
17
|
createAttributeMatcher,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
replaceWxml,
|
|
23
23
|
toCustomAttributesEntities,
|
|
24
24
|
vitePluginName
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-JCG2LT63.mjs";
|
|
26
26
|
import {
|
|
27
27
|
getGroupedEntries
|
|
28
28
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
@@ -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
|
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OBOKBKZQ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JCG2LT63.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -1,10 +1,10 @@
|
|
|
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 _chunkYXT3T3LHjs = require('./chunk-YXT3T3LH.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkMNZW5VG5js = require('./chunk-MNZW5VG5.js');
|
|
8
8
|
|
|
9
9
|
// src/bundlers/webpack/shared/css-imports.ts
|
|
10
10
|
var CSS_EXT_RE = /\.(?:css|scss|sass|less|styl|pcss)$/i;
|
|
@@ -34,7 +34,7 @@ function rewriteTailwindcssRequestForCss(data, pkgDir, appType) {
|
|
|
34
34
|
if (!CSS_EXT_RE.test(normalizedIssuer)) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
const resolved =
|
|
37
|
+
const resolved = _chunkYXT3T3LHjs.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
|
|
38
38
|
if (!resolved) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
@@ -44,8 +44,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
|
44
44
|
if (!options.enabled) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
48
|
-
factory.hooks.beforeResolve.tap(
|
|
47
|
+
compiler.hooks.normalModuleFactory.tap(_chunkMNZW5VG5js.pluginName, (factory) => {
|
|
48
|
+
factory.hooks.beforeResolve.tap(_chunkMNZW5VG5js.pluginName, (data) => {
|
|
49
49
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
50
50
|
});
|
|
51
51
|
});
|
|
@@ -75,7 +75,7 @@ function createPrioritizedFinder(targets) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
function createLoaderAnchorFinders(appType) {
|
|
78
|
-
if (
|
|
78
|
+
if (_chunkYXT3T3LHjs.isMpx.call(void 0, appType)) {
|
|
79
79
|
return {
|
|
80
80
|
findRewriteAnchor: createPrioritizedFinder(MPX_REWRITE_PRECEDENCE_LOADERS),
|
|
81
81
|
findClassSetAnchor: createFinder([MPX_STYLE_COMPILER_LOADER])
|
|
@@ -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.10",
|
|
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:*",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkW7H4R6CPjs = require('./chunk-W7H4R6CP.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.10",
|
|
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(_chunkW7H4R6CPjs.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 = _chunkW7H4R6CPjs.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
|
+
_chunkW7H4R6CPjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2782
|
+
const cssCalcOptions = _chunkW7H4R6CPjs.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 = _chunkW7H4R6CPjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2801
2802
|
Object.assign(previousPatcher, nextPatcher);
|
|
2802
2803
|
ctx.twPatcher = previousPatcher;
|
|
2803
2804
|
return previousPatcher;
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkYXT3T3LHjs = require('./chunk-YXT3T3LH.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkXP5623NLjs = require('./chunk-XP5623NL.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -22,7 +22,7 @@ var _chunk6UW6DOPIjs = require('./chunk-6UW6DOPI.js');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkMNZW5VG5js = require('./chunk-MNZW5VG5.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -54,7 +54,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
54
54
|
const start = prop.value.loc.start.offset + 1;
|
|
55
55
|
const end = prop.value.loc.end.offset - 1;
|
|
56
56
|
if (start < end) {
|
|
57
|
-
ms.update(start, end,
|
|
57
|
+
ms.update(start, end, _chunkMNZW5VG5js.replaceWxml.call(void 0, prop.value.content));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -66,7 +66,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
66
66
|
if (start >= end) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const generated =
|
|
69
|
+
const generated = _chunkMNZW5VG5js.generateCode.call(void 0, prop.exp.content, {
|
|
70
70
|
jsHandler,
|
|
71
71
|
runtimeSet,
|
|
72
72
|
wrapExpression: true
|
|
@@ -95,7 +95,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
98
|
-
const matchCustomAttribute =
|
|
98
|
+
const matchCustomAttribute = _chunkMNZW5VG5js.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
99
99
|
const ms = new (0, _magicstring2.default)(code);
|
|
100
100
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
101
101
|
if (errors.length === 0) {
|
|
@@ -326,7 +326,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
326
326
|
runtimeSet,
|
|
327
327
|
applyLinkedResults: applyLinkedResults2
|
|
328
328
|
} = options;
|
|
329
|
-
const absoluteFile =
|
|
329
|
+
const absoluteFile = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
330
330
|
const rawSource = originalSource.source.toString();
|
|
331
331
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
332
332
|
cache,
|
|
@@ -361,8 +361,8 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
// src/bundlers/vite/index.ts
|
|
364
|
-
var debug =
|
|
365
|
-
var weappTailwindcssPackageDir =
|
|
364
|
+
var debug = _chunkMNZW5VG5js.createDebug.call(void 0, );
|
|
365
|
+
var weappTailwindcssPackageDir = _chunkYXT3T3LHjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
366
366
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
367
367
|
function joinPosixPath(base, subpath) {
|
|
368
368
|
if (base.endsWith("/")) {
|
|
@@ -406,7 +406,7 @@ function isJavaScriptEntry(entry) {
|
|
|
406
406
|
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
407
407
|
return {
|
|
408
408
|
resolve(specifier, importer) {
|
|
409
|
-
return
|
|
409
|
+
return _chunkYXT3T3LHjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
|
|
410
410
|
},
|
|
411
411
|
load(id) {
|
|
412
412
|
const entry = entries.get(id);
|
|
@@ -444,7 +444,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
444
444
|
}
|
|
445
445
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
446
446
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
447
|
-
const opts =
|
|
447
|
+
const opts = _chunkMNZW5VG5js.getCompilerContext.call(void 0, options);
|
|
448
448
|
const {
|
|
449
449
|
disabled,
|
|
450
450
|
customAttributes,
|
|
@@ -466,8 +466,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
466
466
|
if (disabled) {
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
|
-
const customAttributesEntities =
|
|
470
|
-
const patchRecorderState =
|
|
469
|
+
const customAttributesEntities = _chunkMNZW5VG5js.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
470
|
+
const patchRecorderState = _chunkXP5623NLjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
471
471
|
source: "runtime",
|
|
472
472
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
473
473
|
});
|
|
@@ -481,7 +481,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
481
481
|
let runtimeSetPromise;
|
|
482
482
|
let resolvedConfig;
|
|
483
483
|
async function refreshRuntimeState(force) {
|
|
484
|
-
const refreshed = await
|
|
484
|
+
const refreshed = await _chunkMNZW5VG5js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
485
485
|
if (refreshed) {
|
|
486
486
|
runtimeSet = void 0;
|
|
487
487
|
runtimeSetPromise = void 0;
|
|
@@ -494,7 +494,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
494
494
|
return runtimeSet;
|
|
495
495
|
}
|
|
496
496
|
if (force || !runtimeSetPromise) {
|
|
497
|
-
const task2 =
|
|
497
|
+
const task2 = _chunkMNZW5VG5js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
498
498
|
force: force || !runtimeSet,
|
|
499
499
|
skipRefresh: force
|
|
500
500
|
});
|
|
@@ -514,12 +514,12 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
514
514
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && (rewriteCssImportsSpecified || (_nullishCoalesce(runtimeState.twPatcher.majorVersion, () => ( 0))) >= 4);
|
|
515
515
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
516
516
|
{
|
|
517
|
-
name: `${
|
|
517
|
+
name: `${_chunkMNZW5VG5js.vitePluginName}:rewrite-css-imports`,
|
|
518
518
|
enforce: "pre",
|
|
519
519
|
resolveId: {
|
|
520
520
|
order: "pre",
|
|
521
521
|
handler(id, importer) {
|
|
522
|
-
const replacement =
|
|
522
|
+
const replacement = _chunkYXT3T3LHjs.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
|
|
523
523
|
join: joinPosixPath,
|
|
524
524
|
appType
|
|
525
525
|
});
|
|
@@ -538,7 +538,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
538
538
|
if (!isCSSRequest(id)) {
|
|
539
539
|
return null;
|
|
540
540
|
}
|
|
541
|
-
const rewritten =
|
|
541
|
+
const rewritten = _chunkYXT3T3LHjs.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
|
|
542
542
|
join: joinPosixPath,
|
|
543
543
|
appType
|
|
544
544
|
});
|
|
@@ -568,7 +568,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
568
568
|
const plugins = [
|
|
569
569
|
...rewritePlugins,
|
|
570
570
|
{
|
|
571
|
-
name: `${
|
|
571
|
+
name: `${_chunkMNZW5VG5js.vitePluginName}:post`,
|
|
572
572
|
enforce: "post",
|
|
573
573
|
configResolved(config) {
|
|
574
574
|
resolvedConfig = config;
|
|
@@ -594,7 +594,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
594
594
|
for (const [fileName, output] of entries) {
|
|
595
595
|
const entry = { fileName, output };
|
|
596
596
|
if (isJavaScriptEntry(entry)) {
|
|
597
|
-
const absolute =
|
|
597
|
+
const absolute = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, fileName, outDir);
|
|
598
598
|
jsEntries.set(absolute, entry);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
@@ -661,7 +661,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
661
661
|
if (Array.isArray(groupedEntries.js)) {
|
|
662
662
|
for (const [file, originalSource] of groupedEntries.js) {
|
|
663
663
|
if (originalSource.type === "chunk") {
|
|
664
|
-
const absoluteFile =
|
|
664
|
+
const absoluteFile = _chunkYXT3T3LHjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
665
665
|
const initialRawSource = originalSource.code;
|
|
666
666
|
jsTaskFactories.push(async () => {
|
|
667
667
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
@@ -742,7 +742,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
742
742
|
);
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
|
-
|
|
745
|
+
_chunkYXT3T3LHjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
746
746
|
await Promise.all(tasks);
|
|
747
747
|
for (const apply of pendingLinkedUpdates) {
|
|
748
748
|
apply();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.2__@swc+core@1.15.3_@swc+h_b5f09ec5c50315727a8dc02bf80354c5/node_modules/tsup/assets/esm_shims.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkINF2Q5LIjs = require('./chunk-INF2Q5LI.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 _chunkXP5623NLjs = require('./chunk-XP5623NL.js');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkMNZW5VG5js = require('./chunk-MNZW5VG5.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 = _chunkMNZW5VG5js.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 = _chunkMNZW5VG5js.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
|
+
_chunkINF2Q5LIjs.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 = _chunkXP5623NLjs.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 _chunkMNZW5VG5js.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 _chunkMNZW5VG5js.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 } = _chunkINF2Q5LIjs.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(_chunkMNZW5VG5js.pluginName, (compilation) => {
|
|
139
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkMNZW5VG5js.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 = _chunkINF2Q5LIjs.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 && !_chunkINF2Q5LIjs.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: _chunkMNZW5VG5js.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 _chunkMNZW5VG5js.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 = _chunkINF2Q5LIjs.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 @@
|
|
|
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);
|