weapp-tailwindcss 4.8.15 → 4.9.0
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-4ZJEFTPC.mjs → chunk-3M464H7S.mjs} +2 -2
- package/dist/{chunk-PIVX3SXU.js → chunk-4FB4YO6F.js} +15 -15
- package/dist/{chunk-QYYQDG6A.mjs → chunk-4Z6MHSEO.mjs} +4 -4
- package/dist/{chunk-K3XO75VC.mjs → chunk-6OOJ46QK.mjs} +3 -3
- package/dist/{chunk-3URI7W6X.js → chunk-6R4BK6D6.js} +5 -5
- package/dist/{chunk-7UBHTADV.js → chunk-A2OSQ5CV.js} +14 -14
- package/dist/{chunk-UW3WHSZ5.js → chunk-FMBPNII7.js} +7 -1
- package/dist/{chunk-FQX7YIN5.mjs → chunk-GIUNRP65.mjs} +2 -2
- package/dist/{chunk-I7VIMPUB.js → chunk-IGTIMGCP.js} +5 -5
- package/dist/{chunk-W3CX5DGR.js → chunk-NNYRZ4FL.js} +24 -24
- package/dist/{chunk-J4MI4EJO.js → chunk-PT4IJT3Q.js} +5 -3
- package/dist/{chunk-XRYCPSQC.mjs → chunk-QJTJC5UT.mjs} +1 -1
- package/dist/{chunk-DGL3SP2H.js → chunk-QZJTOS3U.js} +3 -3
- package/dist/{chunk-H4BVDT5Q.js → chunk-RMTGZQHJ.js} +7 -7
- package/dist/{chunk-ZNKIYZRQ.mjs → chunk-RR5HCKVQ.mjs} +6 -0
- package/dist/{chunk-3VIPMWAG.mjs → chunk-SZOXLSNK.mjs} +4 -2
- package/dist/{chunk-QF65JGNW.mjs → chunk-TFOTUR4L.mjs} +1 -1
- package/dist/{chunk-7LRI7LJO.mjs → chunk-YJ4NK2AE.mjs} +4 -4
- package/dist/cli.js +40 -40
- package/dist/cli.mjs +4 -4
- package/dist/core.js +11 -11
- package/dist/core.mjs +5 -5
- package/dist/css-macro.js +2 -2
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +6 -6
- package/dist/index.js +10 -10
- package/dist/index.mjs +9 -9
- package/dist/presets.js +7 -7
- package/dist/presets.mjs +2 -2
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +6 -6
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +7 -7
- package/dist/webpack4.js +27 -27
- package/dist/webpack4.mjs +6 -6
- package/package.json +3 -3
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GIUNRP65.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -12,7 +12,7 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,10 +23,10 @@ var _chunkI7VIMPUBjs = require('./chunk-I7VIMPUB.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
30
30
|
|
|
31
31
|
// src/bundlers/vite/index.ts
|
|
32
32
|
var _buffer = require('buffer');
|
|
@@ -55,7 +55,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
55
55
|
const start = prop.value.loc.start.offset + 1;
|
|
56
56
|
const end = prop.value.loc.end.offset - 1;
|
|
57
57
|
if (start < end) {
|
|
58
|
-
ms.update(start, end,
|
|
58
|
+
ms.update(start, end, _chunkA2OSQ5CVjs.replaceWxml.call(void 0, prop.value.content));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -67,7 +67,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
67
67
|
if (start >= end) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
const generated =
|
|
70
|
+
const generated = _chunkA2OSQ5CVjs.generateCode.call(void 0, prop.exp.content, {
|
|
71
71
|
jsHandler,
|
|
72
72
|
runtimeSet,
|
|
73
73
|
wrapExpression: true
|
|
@@ -96,7 +96,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
99
|
-
const matchCustomAttribute =
|
|
99
|
+
const matchCustomAttribute = _chunkA2OSQ5CVjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
100
100
|
const ms = new (0, _magicstring2.default)(code);
|
|
101
101
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
102
102
|
if (errors.length === 0) {
|
|
@@ -379,7 +379,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
// src/bundlers/vite/index.ts
|
|
382
|
-
var debug =
|
|
382
|
+
var debug = _chunkA2OSQ5CVjs.createDebug.call(void 0, );
|
|
383
383
|
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
384
384
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
385
385
|
function joinPosixPath(base, subpath) {
|
|
@@ -462,7 +462,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
462
462
|
}
|
|
463
463
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
464
464
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
465
|
-
const opts =
|
|
465
|
+
const opts = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
466
466
|
const {
|
|
467
467
|
disabled,
|
|
468
468
|
customAttributes,
|
|
@@ -486,7 +486,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
486
486
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
487
487
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
488
488
|
{
|
|
489
|
-
name: `${
|
|
489
|
+
name: `${_chunkA2OSQ5CVjs.vitePluginName}:rewrite-css-imports`,
|
|
490
490
|
enforce: "pre",
|
|
491
491
|
resolveId: {
|
|
492
492
|
order: "pre",
|
|
@@ -528,8 +528,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
528
528
|
if (disabledOptions.plugin) {
|
|
529
529
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
530
530
|
}
|
|
531
|
-
const customAttributesEntities =
|
|
532
|
-
const patchRecorderState =
|
|
531
|
+
const customAttributesEntities = _chunkA2OSQ5CVjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
532
|
+
const patchRecorderState = _chunkIGTIMGCPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
533
533
|
source: "runtime",
|
|
534
534
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
535
535
|
});
|
|
@@ -543,7 +543,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
543
543
|
let runtimeSetPromise;
|
|
544
544
|
let resolvedConfig;
|
|
545
545
|
async function refreshRuntimeState(force) {
|
|
546
|
-
const refreshed = await
|
|
546
|
+
const refreshed = await _chunkA2OSQ5CVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
547
547
|
if (refreshed) {
|
|
548
548
|
runtimeSet = void 0;
|
|
549
549
|
runtimeSetPromise = void 0;
|
|
@@ -556,7 +556,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
556
556
|
return runtimeSet;
|
|
557
557
|
}
|
|
558
558
|
if (force || !runtimeSetPromise) {
|
|
559
|
-
const task2 =
|
|
559
|
+
const task2 = _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
560
560
|
force: force || !runtimeSet,
|
|
561
561
|
skipRefresh: force
|
|
562
562
|
});
|
|
@@ -588,7 +588,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
588
588
|
const plugins = [
|
|
589
589
|
...rewritePlugins,
|
|
590
590
|
{
|
|
591
|
-
name: `${
|
|
591
|
+
name: `${_chunkA2OSQ5CVjs.vitePluginName}:post`,
|
|
592
592
|
enforce: "post",
|
|
593
593
|
configResolved(config) {
|
|
594
594
|
resolvedConfig = config;
|
|
@@ -619,7 +619,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
const moduleGraphOptions = createBundleModuleGraphOptions(outDir, jsEntries);
|
|
622
|
-
const groupedEntries =
|
|
622
|
+
const groupedEntries = _chunkFMBPNII7js.getGroupedEntries.call(void 0, entries, opts);
|
|
623
623
|
const runtime = await ensureRuntimeClassSet(true);
|
|
624
624
|
debug("get runtimeSet, class count: %d", runtime.size);
|
|
625
625
|
const handleLinkedUpdate = (fileName, previous, next) => {
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
createTailwindcssPatcherFromContext,
|
|
4
4
|
findNearestPackageRoot,
|
|
5
5
|
warnMissingCssEntries
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SZOXLSNK.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getDefaultOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TFOTUR4L.mjs";
|
|
10
10
|
import {
|
|
11
11
|
defuOverrideArray,
|
|
12
12
|
isMap
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RR5HCKVQ.mjs";
|
|
14
14
|
|
|
15
15
|
// src/tailwindcss/runtime.ts
|
|
16
16
|
import { statSync } from "fs";
|
|
@@ -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.
|
|
190
|
+
version: "4.9.0",
|
|
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",
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GIUNRP65.mjs";
|
|
16
16
|
import {
|
|
17
17
|
collectRuntimeClassSet,
|
|
18
18
|
createAttributeMatcher,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
replaceWxml,
|
|
24
24
|
toCustomAttributesEntities,
|
|
25
25
|
vitePluginName
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getGroupedEntries
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-RR5HCKVQ.mjs";
|
|
30
30
|
|
|
31
31
|
// src/bundlers/vite/index.ts
|
|
32
32
|
import { Buffer } from "buffer";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
4
4
|
|
|
5
5
|
// src/defaults.ts
|
|
6
6
|
var _escape = require('@weapp-core/escape');
|
|
@@ -77,10 +77,10 @@ function getDefaultOptions() {
|
|
|
77
77
|
"border-color": "currentColor"
|
|
78
78
|
},
|
|
79
79
|
disabled: false,
|
|
80
|
-
onLoad:
|
|
81
|
-
onStart:
|
|
82
|
-
onEnd:
|
|
83
|
-
onUpdate:
|
|
80
|
+
onLoad: _chunkFMBPNII7js.noop,
|
|
81
|
+
onStart: _chunkFMBPNII7js.noop,
|
|
82
|
+
onEnd: _chunkFMBPNII7js.noop,
|
|
83
|
+
onUpdate: _chunkFMBPNII7js.noop,
|
|
84
84
|
customAttributes: {},
|
|
85
85
|
customReplaceDictionary: _escape.MappingChars2String,
|
|
86
86
|
appType: void 0,
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkPT4IJT3Qjs = require('./chunk-PT4IJT3Q.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk6R4BK6D6js = require('./chunk-6R4BK6D6.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
14
14
|
|
|
15
15
|
// src/tailwindcss/runtime.ts
|
|
16
16
|
var _fs = require('fs');
|
|
@@ -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.
|
|
190
|
+
version: "4.9.0",
|
|
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(_chunkPT4IJT3Qjs.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;
|
|
@@ -913,7 +913,7 @@ function toCustomAttributesEntities(customAttributes) {
|
|
|
913
913
|
if (!customAttributes) {
|
|
914
914
|
return [];
|
|
915
915
|
}
|
|
916
|
-
if (
|
|
916
|
+
if (_chunkFMBPNII7js.isMap.call(void 0, customAttributes)) {
|
|
917
917
|
return [
|
|
918
918
|
...customAttributes.entries()
|
|
919
919
|
];
|
|
@@ -2201,7 +2201,7 @@ function createJsHandler(options) {
|
|
|
2201
2201
|
} = options;
|
|
2202
2202
|
function handler(rawSource, classNameSet, options2) {
|
|
2203
2203
|
const overrideOptions = _nullishCoalesce(options2, () => ( {}));
|
|
2204
|
-
const resolvedOptions =
|
|
2204
|
+
const resolvedOptions = _chunkFMBPNII7js.defuOverrideArray.call(void 0,
|
|
2205
2205
|
{
|
|
2206
2206
|
...overrideOptions,
|
|
2207
2207
|
classNameSet
|
|
@@ -2630,7 +2630,7 @@ async function customTemplateHandler(rawSource, options) {
|
|
|
2630
2630
|
}
|
|
2631
2631
|
function createTemplateHandler(options = {}) {
|
|
2632
2632
|
return (rawSource, opt = {}) => {
|
|
2633
|
-
return customTemplateHandler(rawSource,
|
|
2633
|
+
return customTemplateHandler(rawSource, _chunkFMBPNII7js.defuOverrideArray.call(void 0, opt, options));
|
|
2634
2634
|
};
|
|
2635
2635
|
}
|
|
2636
2636
|
|
|
@@ -2764,22 +2764,22 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
2764
2764
|
}
|
|
2765
2765
|
}
|
|
2766
2766
|
function createInternalCompilerContext(opts) {
|
|
2767
|
-
const ctx =
|
|
2767
|
+
const ctx = _chunkFMBPNII7js.defuOverrideArray.call(void 0,
|
|
2768
2768
|
opts,
|
|
2769
|
-
|
|
2769
|
+
_chunk6R4BK6D6js.getDefaultOptions.call(void 0, ),
|
|
2770
2770
|
{}
|
|
2771
2771
|
);
|
|
2772
2772
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2773
2773
|
applyLoggerLevel(ctx.logLevel);
|
|
2774
|
-
const twPatcher =
|
|
2774
|
+
const twPatcher = _chunkPT4IJT3Qjs.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
|
+
_chunkPT4IJT3Qjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2782
|
+
const cssCalcOptions = _chunkPT4IJT3Qjs.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 = _chunkPT4IJT3Qjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2802
2802
|
Object.assign(previousPatcher, nextPatcher);
|
|
2803
2803
|
ctx.twPatcher = previousPatcher;
|
|
2804
2804
|
return previousPatcher;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/utils/index.ts
|
|
2
2
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
3
|
+
|
|
4
|
+
// src/utils/hbuilderx.ts
|
|
5
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
6
|
+
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
7
|
+
|
|
8
|
+
// src/utils/index.ts
|
|
3
9
|
function classifyEntry(filename, options) {
|
|
4
10
|
if (options.cssMatcher(filename)) {
|
|
5
11
|
return "css";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPatchTargetRecorder,
|
|
3
3
|
createTailwindPatchPromise
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SZOXLSNK.mjs";
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
@@ -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 _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkPT4IJT3Qjs = require('./chunk-PT4IJT3Q.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkA2OSQ5CVjs.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
|
+
_chunkPT4IJT3Qjs.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 ? _chunkA2OSQ5CVjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkQZJTOS3Ujs = require('./chunk-QZJTOS3U.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,27 +22,27 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
36
36
|
|
|
37
37
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
38
38
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
39
39
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
40
40
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
41
|
-
var debug =
|
|
41
|
+
var debug = _chunkA2OSQ5CVjs.createDebug.call(void 0, );
|
|
42
42
|
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
43
43
|
var UnifiedWebpackPluginV5 = class {
|
|
44
44
|
constructor(options = {}) {
|
|
45
|
-
this.options =
|
|
45
|
+
this.options = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
46
46
|
this.appType = this.options.appType;
|
|
47
47
|
}
|
|
48
48
|
apply(compiler) {
|
|
@@ -66,19 +66,19 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
66
66
|
const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
|
|
67
67
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
68
68
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
69
|
-
const isMpxApp =
|
|
69
|
+
const isMpxApp = _chunkQZJTOS3Ujs.isMpx.call(void 0, this.appType);
|
|
70
70
|
if (shouldRewriteCssImports) {
|
|
71
|
-
|
|
71
|
+
_chunkQZJTOS3Ujs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
72
72
|
pkgDir: weappTailwindcssPackageDir,
|
|
73
73
|
enabled: true,
|
|
74
74
|
appType: this.appType
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
_chunkQZJTOS3Ujs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
77
77
|
}
|
|
78
78
|
if (disabledOptions.plugin) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const patchRecorderState =
|
|
81
|
+
const patchRecorderState = _chunkIGTIMGCPjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
82
82
|
source: "runtime",
|
|
83
83
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
84
84
|
});
|
|
@@ -89,14 +89,14 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
89
89
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
90
90
|
};
|
|
91
91
|
const refreshRuntimeState = async (force) => {
|
|
92
|
-
await
|
|
92
|
+
await _chunkA2OSQ5CVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
93
93
|
};
|
|
94
94
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
95
95
|
const { ConcatSource } = sources;
|
|
96
96
|
async function getClassSetInLoader() {
|
|
97
97
|
await refreshRuntimeState(true);
|
|
98
98
|
await runtimeState.patchPromise;
|
|
99
|
-
await
|
|
99
|
+
await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
100
100
|
}
|
|
101
101
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
102
102
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -109,16 +109,16 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
109
109
|
const classSetLoaderOptions = {
|
|
110
110
|
getClassSet: getClassSetInLoader
|
|
111
111
|
};
|
|
112
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
112
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkQZJTOS3Ujs.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
113
113
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
114
114
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
115
115
|
} : void 0;
|
|
116
116
|
onLoad();
|
|
117
117
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
118
|
-
|
|
118
|
+
_chunkQZJTOS3Ujs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
119
119
|
}
|
|
120
120
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
121
|
-
|
|
121
|
+
_chunkQZJTOS3Ujs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
122
122
|
}
|
|
123
123
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
124
124
|
loader: runtimeClassSetLoader,
|
|
@@ -137,17 +137,17 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
137
137
|
type: null
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
|
-
compiler.hooks.compilation.tap(
|
|
141
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
140
|
+
compiler.hooks.compilation.tap(_chunkA2OSQ5CVjs.pluginName, (compilation) => {
|
|
141
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkA2OSQ5CVjs.pluginName, (_loaderContext, module) => {
|
|
142
142
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
143
143
|
if (!hasRuntimeLoader) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
_chunkQZJTOS3Ujs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
|
|
147
147
|
const loaderEntries = module.loaders || [];
|
|
148
148
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
149
149
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
150
|
-
const isCssModule =
|
|
150
|
+
const isCssModule = _chunkQZJTOS3Ujs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
151
151
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
152
152
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
153
153
|
}
|
|
@@ -179,7 +179,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
179
179
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
if (runtimeClassSetLoaderExists && !
|
|
182
|
+
if (runtimeClassSetLoaderExists && !_chunkQZJTOS3Ujs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
183
183
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
184
184
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
185
185
|
if (anchorIndex === -1) {
|
|
@@ -192,7 +192,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
192
192
|
});
|
|
193
193
|
compilation.hooks.processAssets.tapPromise(
|
|
194
194
|
{
|
|
195
|
-
name:
|
|
195
|
+
name: _chunkA2OSQ5CVjs.pluginName,
|
|
196
196
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
197
197
|
},
|
|
198
198
|
async (assets) => {
|
|
@@ -258,10 +258,10 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
258
258
|
debug("js linked handle: %s", assetName);
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
|
-
const groupedEntries =
|
|
261
|
+
const groupedEntries = _chunkFMBPNII7js.getGroupedEntries.call(void 0, entries, this.options);
|
|
262
262
|
await refreshRuntimeState(true);
|
|
263
263
|
await runtimeState.patchPromise;
|
|
264
|
-
const runtimeSet = await
|
|
264
|
+
const runtimeSet = await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
265
265
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
266
266
|
const tasks = [];
|
|
267
267
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -298,7 +298,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
298
298
|
const jsTaskFactories = [];
|
|
299
299
|
if (Array.isArray(groupedEntries.js)) {
|
|
300
300
|
for (const [file] of groupedEntries.js) {
|
|
301
|
-
const cacheKey =
|
|
301
|
+
const cacheKey = _chunkQZJTOS3Ujs.getCacheKey.call(void 0, file);
|
|
302
302
|
const asset = compilation.getAsset(file);
|
|
303
303
|
if (!asset) {
|
|
304
304
|
continue;
|
|
@@ -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 _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkMB4BR57Ejs = require('./chunk-MB4BR57E.js');
|
|
@@ -424,7 +424,9 @@ function normalizeTailwindcssPatcherOptions(options) {
|
|
|
424
424
|
}
|
|
425
425
|
function createTailwindcssPatcher(options) {
|
|
426
426
|
const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, tailwindcssPatcherOptions } = options || {};
|
|
427
|
-
const cache = {
|
|
427
|
+
const cache = {
|
|
428
|
+
driver: "memory"
|
|
429
|
+
};
|
|
428
430
|
const normalizedBasedir = basedir ? _path2.default.resolve(basedir) : void 0;
|
|
429
431
|
const cacheRoot = _nullishCoalesce(_nullishCoalesce(findNearestPackageRoot(normalizedBasedir), () => ( normalizedBasedir)), () => ( _process2.default.cwd()));
|
|
430
432
|
if (cacheDir) {
|
|
@@ -706,7 +708,7 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
706
708
|
if (_optionalChain([cssEntries, 'optionalAccess', _40 => _40.length]) && (tailwindcss == null || tailwindcss.version == null)) {
|
|
707
709
|
defaultTailwindcssConfig.version = 4;
|
|
708
710
|
}
|
|
709
|
-
const mergedTailwindOptions =
|
|
711
|
+
const mergedTailwindOptions = _chunkFMBPNII7js.defuOverrideArray.call(void 0,
|
|
710
712
|
_nullishCoalesce(tailwindcss, () => ( {})),
|
|
711
713
|
defaultTailwindcssConfig
|
|
712
714
|
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -154,8 +154,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
|
154
154
|
if (!options.enabled) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
158
|
-
factory.hooks.beforeResolve.tap(
|
|
157
|
+
compiler.hooks.normalModuleFactory.tap(_chunkA2OSQ5CVjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkA2OSQ5CVjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.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 = _chunkA2OSQ5CVjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunkIGTIMGCPjs.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 _chunkA2OSQ5CVjs.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 _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// src/utils/index.ts
|
|
2
2
|
import { defu, defuOverrideArray, groupBy, isMap, isRegexp, noop, regExpTest, removeExt } from "@weapp-tailwindcss/shared";
|
|
3
|
+
|
|
4
|
+
// src/utils/hbuilderx.ts
|
|
5
|
+
import path from "path";
|
|
6
|
+
import process from "process";
|
|
7
|
+
|
|
8
|
+
// src/utils/index.ts
|
|
3
9
|
function classifyEntry(filename, options) {
|
|
4
10
|
if (options.cssMatcher(filename)) {
|
|
5
11
|
return "css";
|