weapp-tailwindcss 4.9.1 → 4.9.2-alpha.1
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-WOJCMQDF.js → chunk-2QR4UOHA.js} +5 -5
- package/dist/{chunk-HEBIKTBC.mjs → chunk-3LRQLHOG.mjs} +24 -8
- package/dist/{chunk-CYKRAS6K.js → chunk-D2ZOXBOU.js} +7 -7
- package/dist/{chunk-YDM2M3NT.js → chunk-EOCBETCN.js} +3 -3
- package/dist/{chunk-7JV2EGN7.mjs → chunk-FAUL26KB.mjs} +3 -3
- package/dist/{chunk-BC6TZREM.mjs → chunk-GKFJPK5V.mjs} +2 -2
- package/dist/{chunk-F4HOQ6DE.js → chunk-HNNJH4ZX.js} +7 -7
- package/dist/{chunk-BIFOYWIB.js → chunk-IC2XBOKV.js} +13 -13
- package/dist/{chunk-W33YZK2C.mjs → chunk-IK5SFZ6A.mjs} +2 -2
- package/dist/{chunk-65CKEW6P.js → chunk-O2XZFBRS.js} +22 -22
- package/dist/{chunk-J4FEPPRP.mjs → chunk-OU6P3233.mjs} +2 -2
- package/dist/{chunk-O35YNDUX.mjs → chunk-VZLUWOGQ.mjs} +1 -1
- package/dist/{chunk-VNGPHRAS.mjs → chunk-W3Z55EVM.mjs} +2 -2
- package/dist/{chunk-APJY6PQW.js → chunk-Y4A76SWP.js} +25 -9
- package/dist/cli.js +38 -38
- package/dist/cli.mjs +2 -2
- package/dist/core.js +9 -9
- package/dist/core.mjs +3 -3
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/presets.js +4 -4
- package/dist/presets.mjs +1 -1
- package/dist/vite.js +5 -5
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +6 -6
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.js +24 -24
- package/dist/webpack4.mjs +4 -4
- package/package.json +3 -3
|
@@ -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 _chunkD2ZOXBOUjs = require('./chunk-D2ZOXBOU.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkY4A76SWPjs = require('./chunk-Y4A76SWP.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkD2ZOXBOUjs.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
|
+
_chunkY4A76SWPjs.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 ? _chunkD2ZOXBOUjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -689,6 +689,7 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
689
689
|
tailwindcssPatcherOptions,
|
|
690
690
|
supportCustomLengthUnitsPatch
|
|
691
691
|
} = options;
|
|
692
|
+
const hasCssEntries = Boolean(cssEntries?.length);
|
|
692
693
|
const defaultTailwindcssConfig = {
|
|
693
694
|
cwd: baseDir,
|
|
694
695
|
v2: {
|
|
@@ -697,12 +698,12 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
697
698
|
v3: {
|
|
698
699
|
cwd: baseDir
|
|
699
700
|
},
|
|
700
|
-
v4: {
|
|
701
|
+
v4: hasCssEntries ? { cssEntries } : {
|
|
701
702
|
base: baseDir,
|
|
702
703
|
cssEntries
|
|
703
704
|
}
|
|
704
705
|
};
|
|
705
|
-
if (
|
|
706
|
+
if (hasCssEntries && (tailwindcss == null || tailwindcss.version == null)) {
|
|
706
707
|
defaultTailwindcssConfig.version = 4;
|
|
707
708
|
}
|
|
708
709
|
const mergedTailwindOptions = defuOverrideArray(
|
|
@@ -710,16 +711,22 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
710
711
|
defaultTailwindcssConfig
|
|
711
712
|
);
|
|
712
713
|
if (!mergedTailwindOptions.v4) {
|
|
713
|
-
mergedTailwindOptions.v4 = {
|
|
714
|
+
mergedTailwindOptions.v4 = hasCssEntries ? { cssEntries: cssEntries ?? [] } : {
|
|
714
715
|
base: baseDir,
|
|
715
716
|
cssEntries: cssEntries ?? []
|
|
716
717
|
};
|
|
717
718
|
} else {
|
|
718
|
-
mergedTailwindOptions.v4.base
|
|
719
|
-
|
|
720
|
-
|
|
719
|
+
if (!hasCssEntries && !mergedTailwindOptions.v4.base) {
|
|
720
|
+
mergedTailwindOptions.v4.base = baseDir;
|
|
721
|
+
}
|
|
722
|
+
if (hasCssEntries) {
|
|
723
|
+
if (cssEntries?.length) {
|
|
724
|
+
mergedTailwindOptions.v4.cssEntries = cssEntries;
|
|
725
|
+
} else if (!mergedTailwindOptions.v4.cssEntries) {
|
|
726
|
+
mergedTailwindOptions.v4.cssEntries = [];
|
|
727
|
+
}
|
|
721
728
|
} else if (!mergedTailwindOptions.v4.cssEntries) {
|
|
722
|
-
mergedTailwindOptions.v4.cssEntries = [];
|
|
729
|
+
mergedTailwindOptions.v4.cssEntries = cssEntries ?? [];
|
|
723
730
|
}
|
|
724
731
|
}
|
|
725
732
|
const patchedOptions = overrideTailwindcssPatcherOptionsForBase(
|
|
@@ -762,6 +769,7 @@ function createMultiTailwindcssPatcher(patchers) {
|
|
|
762
769
|
}
|
|
763
770
|
const [first] = patchers;
|
|
764
771
|
const multiPatcher = {
|
|
772
|
+
...first,
|
|
765
773
|
packageInfo: first?.packageInfo,
|
|
766
774
|
majorVersion: first?.majorVersion,
|
|
767
775
|
options: first?.options,
|
|
@@ -1087,8 +1095,16 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
1087
1095
|
if (normalizedCssEntries) {
|
|
1088
1096
|
ctx.cssEntries = normalizedCssEntries;
|
|
1089
1097
|
}
|
|
1098
|
+
const shouldAttachBase = Boolean(ctx.tailwindcssBasedir && normalizedCssEntries?.length);
|
|
1099
|
+
const tailwindcssWithBase = shouldAttachBase && tailwindcss?.v4 !== null ? {
|
|
1100
|
+
...tailwindcss ?? {},
|
|
1101
|
+
v4: {
|
|
1102
|
+
...tailwindcss?.v4 ?? {},
|
|
1103
|
+
base: tailwindcss?.v4?.base ?? resolvedTailwindcssBasedir
|
|
1104
|
+
}
|
|
1105
|
+
} : tailwindcss;
|
|
1090
1106
|
const patcherOptions = {
|
|
1091
|
-
tailwindcss,
|
|
1107
|
+
tailwindcss: tailwindcssWithBase,
|
|
1092
1108
|
tailwindcssPatcherOptions,
|
|
1093
1109
|
supportCustomLengthUnitsPatch,
|
|
1094
1110
|
appType
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkY4A76SWPjs = require('./chunk-Y4A76SWP.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkFYYBY3VKjs = require('./chunk-FYYBY3VK.js');
|
|
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
187
187
|
// package.json
|
|
188
188
|
var package_default = {
|
|
189
189
|
name: "weapp-tailwindcss",
|
|
190
|
-
version: "4.9.1",
|
|
190
|
+
version: "4.9.2-alpha.1",
|
|
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(_chunkY4A76SWPjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
547
547
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
548
548
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
549
549
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -2771,15 +2771,15 @@ function createInternalCompilerContext(opts) {
|
|
|
2771
2771
|
);
|
|
2772
2772
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2773
2773
|
applyLoggerLevel(ctx.logLevel);
|
|
2774
|
-
const twPatcher =
|
|
2774
|
+
const twPatcher = _chunkY4A76SWPjs.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
|
+
_chunkY4A76SWPjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2782
|
+
const cssCalcOptions = _chunkY4A76SWPjs.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 = _chunkY4A76SWPjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2802
2802
|
Object.assign(previousPatcher, nextPatcher);
|
|
2803
2803
|
ctx.twPatcher = previousPatcher;
|
|
2804
2804
|
return previousPatcher;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkD2ZOXBOUjs = require('./chunk-D2ZOXBOU.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(_chunkD2ZOXBOUjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkD2ZOXBOUjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VZLUWOGQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GKFJPK5V.mjs";
|
|
26
26
|
import {
|
|
27
27
|
collectRuntimeClassSet,
|
|
28
28
|
createDebug,
|
|
29
29
|
getCompilerContext,
|
|
30
30
|
pluginName,
|
|
31
31
|
refreshTailwindRuntimeState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-IK5SFZ6A.mjs";
|
|
33
33
|
import {
|
|
34
34
|
getGroupedEntries
|
|
35
35
|
} from "./chunk-OOHJLO5M.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPatchTargetRecorder,
|
|
3
3
|
createTailwindPatchPromise
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IK5SFZ6A.mjs";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3LRQLHOG.mjs";
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk2QR4UOHAjs = require('./chunk-2QR4UOHA.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkD2ZOXBOUjs = require('./chunk-D2ZOXBOU.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 = _chunkD2ZOXBOUjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkD2ZOXBOUjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunk2QR4UOHAjs.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 _chunkD2ZOXBOUjs.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 _chunkD2ZOXBOUjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -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 _chunk2QR4UOHAjs = require('./chunk-2QR4UOHA.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ var _chunkWOJCMQDFjs = require('./chunk-WOJCMQDF.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkD2ZOXBOUjs = require('./chunk-D2ZOXBOU.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -56,7 +56,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
56
56
|
const start = prop.value.loc.start.offset + 1;
|
|
57
57
|
const end = prop.value.loc.end.offset - 1;
|
|
58
58
|
if (start < end) {
|
|
59
|
-
ms.update(start, end,
|
|
59
|
+
ms.update(start, end, _chunkD2ZOXBOUjs.replaceWxml.call(void 0, prop.value.content));
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -68,7 +68,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
68
68
|
if (start >= end) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const generated =
|
|
71
|
+
const generated = _chunkD2ZOXBOUjs.generateCode.call(void 0, prop.exp.content, {
|
|
72
72
|
jsHandler,
|
|
73
73
|
runtimeSet,
|
|
74
74
|
wrapExpression: true
|
|
@@ -97,7 +97,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
100
|
-
const matchCustomAttribute =
|
|
100
|
+
const matchCustomAttribute = _chunkD2ZOXBOUjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
101
101
|
const ms = new (0, _magicstring2.default)(code);
|
|
102
102
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
103
103
|
if (errors.length === 0) {
|
|
@@ -399,7 +399,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
// src/bundlers/vite/index.ts
|
|
402
|
-
var debug =
|
|
402
|
+
var debug = _chunkD2ZOXBOUjs.createDebug.call(void 0, );
|
|
403
403
|
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
404
404
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
405
405
|
function joinPosixPath(base, subpath) {
|
|
@@ -482,7 +482,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
482
482
|
}
|
|
483
483
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
484
484
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
485
|
-
const opts =
|
|
485
|
+
const opts = _chunkD2ZOXBOUjs.getCompilerContext.call(void 0, options);
|
|
486
486
|
const {
|
|
487
487
|
disabled,
|
|
488
488
|
customAttributes,
|
|
@@ -506,7 +506,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
506
506
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
507
507
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
508
508
|
{
|
|
509
|
-
name: `${
|
|
509
|
+
name: `${_chunkD2ZOXBOUjs.vitePluginName}:rewrite-css-imports`,
|
|
510
510
|
enforce: "pre",
|
|
511
511
|
resolveId: {
|
|
512
512
|
order: "pre",
|
|
@@ -548,8 +548,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
548
548
|
if (disabledOptions.plugin) {
|
|
549
549
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
550
550
|
}
|
|
551
|
-
const customAttributesEntities =
|
|
552
|
-
const patchRecorderState =
|
|
551
|
+
const customAttributesEntities = _chunkD2ZOXBOUjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
552
|
+
const patchRecorderState = _chunk2QR4UOHAjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
553
553
|
source: "runtime",
|
|
554
554
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
555
555
|
});
|
|
@@ -563,7 +563,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
563
563
|
let runtimeSetPromise;
|
|
564
564
|
let resolvedConfig;
|
|
565
565
|
async function refreshRuntimeState(force) {
|
|
566
|
-
const refreshed = await
|
|
566
|
+
const refreshed = await _chunkD2ZOXBOUjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
567
567
|
if (refreshed) {
|
|
568
568
|
runtimeSet = void 0;
|
|
569
569
|
runtimeSetPromise = void 0;
|
|
@@ -576,7 +576,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
576
576
|
return runtimeSet;
|
|
577
577
|
}
|
|
578
578
|
if (force || !runtimeSetPromise) {
|
|
579
|
-
const task2 =
|
|
579
|
+
const task2 = _chunkD2ZOXBOUjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
580
580
|
force: force || !runtimeSet,
|
|
581
581
|
skipRefresh: force
|
|
582
582
|
});
|
|
@@ -611,7 +611,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
611
611
|
const plugins = [
|
|
612
612
|
...rewritePlugins,
|
|
613
613
|
{
|
|
614
|
-
name: `${
|
|
614
|
+
name: `${_chunkD2ZOXBOUjs.vitePluginName}:post`,
|
|
615
615
|
enforce: "post",
|
|
616
616
|
configResolved(config) {
|
|
617
617
|
resolvedConfig = config;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createTailwindcssPatcherFromContext,
|
|
4
4
|
findNearestPackageRoot,
|
|
5
5
|
warnMissingCssEntries
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3LRQLHOG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getDefaultOptions
|
|
9
9
|
} from "./chunk-HWF5U4CI.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.9.1",
|
|
190
|
+
version: "4.9.2-alpha.1",
|
|
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",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkEOCBETCNjs = require('./chunk-EOCBETCN.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,14 +22,14 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunk2QR4UOHAjs = require('./chunk-2QR4UOHA.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkD2ZOXBOUjs = require('./chunk-D2ZOXBOU.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -38,11 +38,11 @@ var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
|
38
38
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
39
39
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
40
40
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
41
|
-
var debug =
|
|
41
|
+
var debug = _chunkD2ZOXBOUjs.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 = _chunkD2ZOXBOUjs.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 = _chunkEOCBETCNjs.isMpx.call(void 0, this.appType);
|
|
70
70
|
if (shouldRewriteCssImports) {
|
|
71
|
-
|
|
71
|
+
_chunkEOCBETCNjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
72
72
|
pkgDir: weappTailwindcssPackageDir,
|
|
73
73
|
enabled: true,
|
|
74
74
|
appType: this.appType
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
_chunkEOCBETCNjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
77
77
|
}
|
|
78
78
|
if (disabledOptions.plugin) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const patchRecorderState =
|
|
81
|
+
const patchRecorderState = _chunk2QR4UOHAjs.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 _chunkD2ZOXBOUjs.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 _chunkD2ZOXBOUjs.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 } = _chunkEOCBETCNjs.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
|
+
_chunkEOCBETCNjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
119
119
|
}
|
|
120
120
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
121
|
-
|
|
121
|
+
_chunkEOCBETCNjs.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(_chunkD2ZOXBOUjs.pluginName, (compilation) => {
|
|
141
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkD2ZOXBOUjs.pluginName, (_loaderContext, module) => {
|
|
142
142
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
143
143
|
if (!hasRuntimeLoader) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
_chunkEOCBETCNjs.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 = _chunkEOCBETCNjs.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 && !_chunkEOCBETCNjs.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: _chunkD2ZOXBOUjs.pluginName,
|
|
196
196
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
197
197
|
},
|
|
198
198
|
async (assets) => {
|
|
@@ -261,7 +261,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
261
261
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, this.options);
|
|
262
262
|
await refreshRuntimeState(true);
|
|
263
263
|
await runtimeState.patchPromise;
|
|
264
|
-
const runtimeSet = await
|
|
264
|
+
const runtimeSet = await _chunkD2ZOXBOUjs.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 = _chunkEOCBETCNjs.getCacheKey.call(void 0, file);
|
|
302
302
|
const asset = compilation.getAsset(file);
|
|
303
303
|
if (!asset) {
|
|
304
304
|
continue;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GKFJPK5V.mjs";
|
|
16
16
|
import {
|
|
17
17
|
collectRuntimeClassSet,
|
|
18
18
|
createAttributeMatcher,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
replaceWxml,
|
|
24
24
|
toCustomAttributesEntities,
|
|
25
25
|
vitePluginName
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IK5SFZ6A.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getGroupedEntries,
|
|
29
29
|
resolveUniUtsPlatform
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GKFJPK5V.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IK5SFZ6A.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|