weapp-tailwindcss 4.8.13 → 4.8.14
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-B7643BFR.js → chunk-2AWOAQD3.js} +34 -32
- package/dist/{chunk-4E2U7YIQ.mjs → chunk-2HIXWVX2.mjs} +50 -47
- package/dist/{chunk-HXYNNE6Q.mjs → chunk-3SKEY32E.mjs} +18 -119
- package/dist/{chunk-3S6VRBOM.js → chunk-477TX4LM.js} +3 -3
- package/dist/{chunk-BLTNVVBH.js → chunk-63LJ4WHF.js} +1 -1
- package/dist/chunk-6VSFN3NA.js +251 -0
- package/dist/{chunk-7MREZHFO.mjs → chunk-7UAU27KZ.mjs} +1 -1
- package/dist/{chunk-JSV4IYLL.mjs → chunk-EKF3ABRO.mjs} +2 -2
- package/dist/chunk-FSI2IWUY.mjs +251 -0
- package/dist/{chunk-CSDB62E5.mjs → chunk-HJWY5Y6L.mjs} +14 -12
- package/dist/{chunk-G4UFQ3CK.js → chunk-L3AOBWDW.js} +7 -7
- package/dist/{chunk-U6O2TOS7.js → chunk-ML4F4ZPY.js} +66 -63
- package/dist/{chunk-Z6E242OH.js → chunk-ORSWL3MI.js} +18 -119
- package/dist/{chunk-WHELJMZL.mjs → chunk-ZC5JYOAR.mjs} +1 -1
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.js +8 -8
- package/dist/core.mjs +2 -2
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/types.d.mts +24 -2
- package/dist/types.d.ts +24 -2
- package/dist/vite.js +5 -5
- package/dist/vite.mjs +4 -4
- package/dist/weapp-tw-css-import-rewrite-loader.js +2 -18
- package/dist/weapp-tw-runtime-classset-loader.js +1 -3
- package/dist/webpack.js +6 -6
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.js +35 -33
- package/dist/webpack4.mjs +14 -12
- package/package.json +3 -3
- package/dist/chunk-BYXBJQAS.js +0 -1
- package/dist/chunk-OPA2EYQV.mjs +0 -136
- package/dist/chunk-XX7SUSE7.js +0 -136
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
var
|
|
15
|
+
var _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
@@ -22,7 +23,7 @@ var _chunk3S6VRBOMjs = require('./chunk-3S6VRBOM.js');
|
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
var
|
|
26
|
+
var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -54,7 +55,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
54
55
|
const start = prop.value.loc.start.offset + 1;
|
|
55
56
|
const end = prop.value.loc.end.offset - 1;
|
|
56
57
|
if (start < end) {
|
|
57
|
-
ms.update(start, end,
|
|
58
|
+
ms.update(start, end, _chunk63LJ4WHFjs.replaceWxml.call(void 0, prop.value.content));
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -66,7 +67,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
66
67
|
if (start >= end) {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
|
-
const generated =
|
|
70
|
+
const generated = _chunk63LJ4WHFjs.generateCode.call(void 0, prop.exp.content, {
|
|
70
71
|
jsHandler,
|
|
71
72
|
runtimeSet,
|
|
72
73
|
wrapExpression: true
|
|
@@ -95,7 +96,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
98
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
98
|
-
const matchCustomAttribute =
|
|
99
|
+
const matchCustomAttribute = _chunk63LJ4WHFjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
99
100
|
const ms = new (0, _magicstring2.default)(code);
|
|
100
101
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
101
102
|
if (errors.length === 0) {
|
|
@@ -326,7 +327,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
326
327
|
runtimeSet,
|
|
327
328
|
applyLinkedResults: applyLinkedResults2
|
|
328
329
|
} = options;
|
|
329
|
-
const absoluteFile =
|
|
330
|
+
const absoluteFile = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
330
331
|
const rawSource = originalSource.source.toString();
|
|
331
332
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
332
333
|
cache,
|
|
@@ -361,8 +362,8 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
361
362
|
}
|
|
362
363
|
|
|
363
364
|
// src/bundlers/vite/index.ts
|
|
364
|
-
var debug =
|
|
365
|
-
var weappTailwindcssPackageDir =
|
|
365
|
+
var debug = _chunk63LJ4WHFjs.createDebug.call(void 0, );
|
|
366
|
+
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
366
367
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
367
368
|
function joinPosixPath(base, subpath) {
|
|
368
369
|
if (base.endsWith("/")) {
|
|
@@ -406,7 +407,7 @@ function isJavaScriptEntry(entry) {
|
|
|
406
407
|
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
407
408
|
return {
|
|
408
409
|
resolve(specifier, importer) {
|
|
409
|
-
return
|
|
410
|
+
return _chunkORSWL3MIjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
|
|
410
411
|
},
|
|
411
412
|
load(id) {
|
|
412
413
|
const entry = entries.get(id);
|
|
@@ -444,7 +445,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
444
445
|
}
|
|
445
446
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
446
447
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
447
|
-
const opts =
|
|
448
|
+
const opts = _chunk63LJ4WHFjs.getCompilerContext.call(void 0, options);
|
|
448
449
|
const {
|
|
449
450
|
disabled,
|
|
450
451
|
customAttributes,
|
|
@@ -463,11 +464,55 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
463
464
|
uniAppX,
|
|
464
465
|
disabledDefaultTemplateHandler
|
|
465
466
|
} = opts;
|
|
466
|
-
|
|
467
|
-
|
|
467
|
+
const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
|
|
468
|
+
const tailwindcssMajorVersion = _nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0));
|
|
469
|
+
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
470
|
+
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
471
|
+
{
|
|
472
|
+
name: `${_chunk63LJ4WHFjs.vitePluginName}:rewrite-css-imports`,
|
|
473
|
+
enforce: "pre",
|
|
474
|
+
resolveId: {
|
|
475
|
+
order: "pre",
|
|
476
|
+
handler(id, importer) {
|
|
477
|
+
const replacement = _chunkORSWL3MIjs.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
|
|
478
|
+
join: joinPosixPath,
|
|
479
|
+
appType
|
|
480
|
+
});
|
|
481
|
+
if (!replacement) {
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
if (importer && !isCssLikeImporter(importer)) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
return replacement;
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
transform: {
|
|
491
|
+
order: "pre",
|
|
492
|
+
handler(code, id) {
|
|
493
|
+
if (!isCSSRequest(id)) {
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
const rewritten = _chunkORSWL3MIjs.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
|
|
497
|
+
join: joinPosixPath,
|
|
498
|
+
appType
|
|
499
|
+
});
|
|
500
|
+
if (!rewritten) {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
return {
|
|
504
|
+
code: rewritten,
|
|
505
|
+
map: null
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
];
|
|
511
|
+
if (disabledOptions.plugin) {
|
|
512
|
+
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
468
513
|
}
|
|
469
|
-
const customAttributesEntities =
|
|
470
|
-
const patchRecorderState =
|
|
514
|
+
const customAttributesEntities = _chunk63LJ4WHFjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
515
|
+
const patchRecorderState = _chunk477TX4LMjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
471
516
|
source: "runtime",
|
|
472
517
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
473
518
|
});
|
|
@@ -481,7 +526,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
481
526
|
let runtimeSetPromise;
|
|
482
527
|
let resolvedConfig;
|
|
483
528
|
async function refreshRuntimeState(force) {
|
|
484
|
-
const refreshed = await
|
|
529
|
+
const refreshed = await _chunk63LJ4WHFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
485
530
|
if (refreshed) {
|
|
486
531
|
runtimeSet = void 0;
|
|
487
532
|
runtimeSetPromise = void 0;
|
|
@@ -494,7 +539,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
494
539
|
return runtimeSet;
|
|
495
540
|
}
|
|
496
541
|
if (force || !runtimeSetPromise) {
|
|
497
|
-
const task2 =
|
|
542
|
+
const task2 = _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
498
543
|
force: force || !runtimeSet,
|
|
499
544
|
skipRefresh: force
|
|
500
545
|
});
|
|
@@ -511,48 +556,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
511
556
|
}
|
|
512
557
|
}
|
|
513
558
|
onLoad();
|
|
514
|
-
const shouldRewriteCssImports = opts.rewriteCssImports !== false && (rewriteCssImportsSpecified || (_nullishCoalesce(runtimeState.twPatcher.majorVersion, () => ( 0))) >= 4);
|
|
515
|
-
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
516
|
-
{
|
|
517
|
-
name: `${_chunkBLTNVVBHjs.vitePluginName}:rewrite-css-imports`,
|
|
518
|
-
enforce: "pre",
|
|
519
|
-
resolveId: {
|
|
520
|
-
order: "pre",
|
|
521
|
-
handler(id, importer) {
|
|
522
|
-
const replacement = _chunkZ6E242OHjs.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
|
|
523
|
-
join: joinPosixPath,
|
|
524
|
-
appType
|
|
525
|
-
});
|
|
526
|
-
if (!replacement) {
|
|
527
|
-
return null;
|
|
528
|
-
}
|
|
529
|
-
if (importer && !isCssLikeImporter(importer)) {
|
|
530
|
-
return null;
|
|
531
|
-
}
|
|
532
|
-
return replacement;
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
transform: {
|
|
536
|
-
order: "pre",
|
|
537
|
-
handler(code, id) {
|
|
538
|
-
if (!isCSSRequest(id)) {
|
|
539
|
-
return null;
|
|
540
|
-
}
|
|
541
|
-
const rewritten = _chunkZ6E242OHjs.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
|
|
542
|
-
join: joinPosixPath,
|
|
543
|
-
appType
|
|
544
|
-
});
|
|
545
|
-
if (!rewritten) {
|
|
546
|
-
return null;
|
|
547
|
-
}
|
|
548
|
-
return {
|
|
549
|
-
code: rewritten,
|
|
550
|
-
map: null
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
];
|
|
556
559
|
const getResolvedConfig = () => resolvedConfig;
|
|
557
560
|
const uniAppXPlugins = uniAppX ? createUniAppXPlugins({
|
|
558
561
|
appType,
|
|
@@ -568,7 +571,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
568
571
|
const plugins = [
|
|
569
572
|
...rewritePlugins,
|
|
570
573
|
{
|
|
571
|
-
name: `${
|
|
574
|
+
name: `${_chunk63LJ4WHFjs.vitePluginName}:post`,
|
|
572
575
|
enforce: "post",
|
|
573
576
|
configResolved(config) {
|
|
574
577
|
resolvedConfig = config;
|
|
@@ -594,7 +597,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
594
597
|
for (const [fileName, output] of entries) {
|
|
595
598
|
const entry = { fileName, output };
|
|
596
599
|
if (isJavaScriptEntry(entry)) {
|
|
597
|
-
const absolute =
|
|
600
|
+
const absolute = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, fileName, outDir);
|
|
598
601
|
jsEntries.set(absolute, entry);
|
|
599
602
|
}
|
|
600
603
|
}
|
|
@@ -661,7 +664,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
661
664
|
if (Array.isArray(groupedEntries.js)) {
|
|
662
665
|
for (const [file, originalSource] of groupedEntries.js) {
|
|
663
666
|
if (originalSource.type === "chunk") {
|
|
664
|
-
const absoluteFile =
|
|
667
|
+
const absoluteFile = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
665
668
|
const initialRawSource = originalSource.code;
|
|
666
669
|
jsTaskFactories.push(async () => {
|
|
667
670
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
@@ -742,7 +745,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
742
745
|
);
|
|
743
746
|
}
|
|
744
747
|
}
|
|
745
|
-
|
|
748
|
+
_chunkORSWL3MIjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
746
749
|
await Promise.all(tasks);
|
|
747
750
|
for (const apply of pendingLinkedUpdates) {
|
|
748
751
|
apply();
|
|
@@ -57,8 +57,22 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
|
|
|
57
57
|
return matchWithExtensions(candidate, hasOutput);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
// src/utils/disabled.ts
|
|
61
|
+
function resolveDisabledOptions(disabled) {
|
|
62
|
+
if (disabled === true) {
|
|
63
|
+
return { plugin: true, rewriteCssImports: false };
|
|
64
|
+
}
|
|
65
|
+
if (disabled === false || disabled == null) {
|
|
66
|
+
return { plugin: false, rewriteCssImports: false };
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
plugin: _nullishCoalesce(disabled.plugin, () => ( false)),
|
|
70
|
+
rewriteCssImports: _nullishCoalesce(disabled.rewriteCssImports, () => ( false))
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
60
74
|
// src/utils/resolve-package.ts
|
|
61
|
-
var _module = require('module');
|
|
75
|
+
var _module = require('module');
|
|
62
76
|
|
|
63
77
|
var require2 = _module.createRequire.call(void 0, _chunkMB4BR57Ejs.importMetaUrl);
|
|
64
78
|
function resolvePackageDir(name) {
|
|
@@ -66,117 +80,6 @@ function resolvePackageDir(name) {
|
|
|
66
80
|
return _path2.default.dirname(pkgPath);
|
|
67
81
|
}
|
|
68
82
|
|
|
69
|
-
// src/shared/mpx.ts
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// src/shared/tailwindcss-css-redirect.ts
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var moduleWithMutableResolve = _module2.default;
|
|
76
|
-
var patched = /* @__PURE__ */ new WeakSet();
|
|
77
|
-
function installTailwindcssCssRedirect(pkgDir) {
|
|
78
|
-
const target = _path2.default.join(pkgDir, "index.css");
|
|
79
|
-
const original = moduleWithMutableResolve._resolveFilename;
|
|
80
|
-
if (patched.has(original)) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const replacements = /* @__PURE__ */ new Set(["tailwindcss", "tailwindcss$"]);
|
|
84
|
-
const resolveTailwindcssCss = (request, parent, isMain, options) => {
|
|
85
|
-
if (replacements.has(request)) {
|
|
86
|
-
return target;
|
|
87
|
-
}
|
|
88
|
-
if (request.startsWith("tailwindcss/")) {
|
|
89
|
-
return _path2.default.join(pkgDir, request.slice("tailwindcss/".length));
|
|
90
|
-
}
|
|
91
|
-
return original(request, parent, isMain, options);
|
|
92
|
-
};
|
|
93
|
-
moduleWithMutableResolve._resolveFilename = resolveTailwindcssCss;
|
|
94
|
-
patched.add(moduleWithMutableResolve._resolveFilename);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// src/shared/mpx.ts
|
|
98
|
-
var MPX_STYLE_RESOURCE_QUERY_RE = /(?:^|[?&])type=styles(?:&|$)/;
|
|
99
|
-
function isMpxStyleResourceQuery(query) {
|
|
100
|
-
if (typeof query !== "string") {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
return MPX_STYLE_RESOURCE_QUERY_RE.test(query);
|
|
104
|
-
}
|
|
105
|
-
function isMpx(appType) {
|
|
106
|
-
return appType === "mpx";
|
|
107
|
-
}
|
|
108
|
-
function getTailwindcssCssEntry(pkgDir) {
|
|
109
|
-
return _path2.default.join(pkgDir, "index.css");
|
|
110
|
-
}
|
|
111
|
-
function ensureMpxTailwindcssAliases(compiler, pkgDir) {
|
|
112
|
-
const tailwindcssCssEntry = getTailwindcssCssEntry(pkgDir);
|
|
113
|
-
compiler.options = compiler.options || {};
|
|
114
|
-
compiler.options.resolve = compiler.options.resolve || {};
|
|
115
|
-
const alias = _nullishCoalesce(compiler.options.resolve.alias, () => ( {}));
|
|
116
|
-
if (Array.isArray(alias)) {
|
|
117
|
-
alias.push(
|
|
118
|
-
{ name: "tailwindcss", alias: tailwindcssCssEntry },
|
|
119
|
-
{ name: "tailwindcss$", alias: tailwindcssCssEntry }
|
|
120
|
-
);
|
|
121
|
-
} else {
|
|
122
|
-
compiler.options.resolve.alias = alias;
|
|
123
|
-
alias.tailwindcss = tailwindcssCssEntry;
|
|
124
|
-
alias.tailwindcss$ = tailwindcssCssEntry;
|
|
125
|
-
}
|
|
126
|
-
return tailwindcssCssEntry;
|
|
127
|
-
}
|
|
128
|
-
function patchMpxLoaderResolve(loaderContext, pkgDir, enabled) {
|
|
129
|
-
if (!enabled || typeof loaderContext.resolve !== "function") {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const originalResolve = loaderContext.resolve;
|
|
133
|
-
if (originalResolve.__weappTwPatched) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const tailwindcssCssEntry = getTailwindcssCssEntry(pkgDir);
|
|
137
|
-
const wrappedResolve = function(context, request, callback) {
|
|
138
|
-
if (request === "tailwindcss" || request === "tailwindcss$") {
|
|
139
|
-
return callback(null, tailwindcssCssEntry);
|
|
140
|
-
}
|
|
141
|
-
if (_optionalChain([request, 'optionalAccess', _ => _.startsWith, 'call', _2 => _2("tailwindcss/")])) {
|
|
142
|
-
return callback(null, _path2.default.join(pkgDir, request.slice("tailwindcss/".length)));
|
|
143
|
-
}
|
|
144
|
-
return originalResolve.call(this, context, request, callback);
|
|
145
|
-
};
|
|
146
|
-
wrappedResolve.__weappTwPatched = true;
|
|
147
|
-
loaderContext.resolve = wrappedResolve;
|
|
148
|
-
}
|
|
149
|
-
function setupMpxTailwindcssRedirect(pkgDir, enabled) {
|
|
150
|
-
if (enabled) {
|
|
151
|
-
installTailwindcssCssRedirect(pkgDir);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
function injectMpxCssRewritePreRules(compiler, loader, loaderOptions) {
|
|
155
|
-
var _a;
|
|
156
|
-
if (!loader) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const moduleOptions = _nullishCoalesce((_a = compiler.options).module, () => ( (_a.module = { rules: [] })));
|
|
160
|
-
moduleOptions.rules = moduleOptions.rules || [];
|
|
161
|
-
const createRule = (match) => ({
|
|
162
|
-
...match,
|
|
163
|
-
enforce: "pre",
|
|
164
|
-
use: [
|
|
165
|
-
{
|
|
166
|
-
loader,
|
|
167
|
-
options: loaderOptions
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
});
|
|
171
|
-
moduleOptions.rules.unshift(
|
|
172
|
-
createRule({ resourceQuery: (query) => isMpxStyleResourceQuery(query) }),
|
|
173
|
-
createRule({
|
|
174
|
-
test: /\.css$/i,
|
|
175
|
-
resourceQuery: (query) => !isMpxStyleResourceQuery(query)
|
|
176
|
-
})
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
83
|
// src/bundlers/shared/css-imports.ts
|
|
181
84
|
|
|
182
85
|
var tailwindcssImportRE = /^tailwindcss(?:\/.*)?$/;
|
|
@@ -198,10 +101,10 @@ function resolveTailwindcssImport(specifier, pkgDir, options) {
|
|
|
198
101
|
if (!tailwindcssImportRE.test(normalized)) {
|
|
199
102
|
return null;
|
|
200
103
|
}
|
|
201
|
-
if (
|
|
104
|
+
if (normalized === "tailwindcss") {
|
|
202
105
|
return "weapp-tailwindcss/index.css";
|
|
203
106
|
}
|
|
204
|
-
const join = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
107
|
+
const join = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.join]), () => ( _path2.default.join));
|
|
205
108
|
const subpath = getTailwindcssSubpath(normalized);
|
|
206
109
|
return join(pkgDir, subpath);
|
|
207
110
|
}
|
|
@@ -269,8 +172,4 @@ function pushConcurrentTaskFactories(queue, factories, limit) {
|
|
|
269
172
|
|
|
270
173
|
|
|
271
174
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
exports.toAbsoluteOutputPath = toAbsoluteOutputPath; exports.resolveOutputSpecifier = resolveOutputSpecifier; exports.resolvePackageDir = resolvePackageDir; exports.isMpx = isMpx; exports.ensureMpxTailwindcssAliases = ensureMpxTailwindcssAliases; exports.patchMpxLoaderResolve = patchMpxLoaderResolve; exports.setupMpxTailwindcssRedirect = setupMpxTailwindcssRedirect; exports.injectMpxCssRewritePreRules = injectMpxCssRewritePreRules; exports.resolveTailwindcssImport = resolveTailwindcssImport; exports.rewriteTailwindcssImportsInCode = rewriteTailwindcssImportsInCode; exports.pushConcurrentTaskFactories = pushConcurrentTaskFactories;
|
|
175
|
+
exports.toAbsoluteOutputPath = toAbsoluteOutputPath; exports.resolveOutputSpecifier = resolveOutputSpecifier; exports.resolveDisabledOptions = resolveDisabledOptions; exports.resolvePackageDir = resolvePackageDir; exports.resolveTailwindcssImport = resolveTailwindcssImport; exports.rewriteTailwindcssImportsInCode = rewriteTailwindcssImportsInCode; exports.pushConcurrentTaskFactories = pushConcurrentTaskFactories;
|
|
@@ -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.14",
|
|
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",
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -334,9 +334,9 @@ async function patchWorkspace(options) {
|
|
|
334
334
|
try {
|
|
335
335
|
const patcher = createWorkspacePatcher(dir);
|
|
336
336
|
if (options.clearCache) {
|
|
337
|
-
await
|
|
337
|
+
await _chunk63LJ4WHFjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
338
338
|
}
|
|
339
|
-
const recorder =
|
|
339
|
+
const recorder = _chunk63LJ4WHFjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
|
|
340
340
|
source: "cli",
|
|
341
341
|
cwd: dir,
|
|
342
342
|
recordTarget: options.recordTarget !== false,
|
|
@@ -345,7 +345,7 @@ async function patchWorkspace(options) {
|
|
|
345
345
|
if (_optionalChain([recorder, 'optionalAccess', _13 => _13.message])) {
|
|
346
346
|
_chunkJ4MI4EJOjs.logger.info("[workspace] %s %s", displayName, recorder.message);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
_chunk63LJ4WHFjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
|
|
349
349
|
await patcher.patch();
|
|
350
350
|
if (_optionalChain([recorder, 'optionalAccess', _14 => _14.onPatched])) {
|
|
351
351
|
await recorder.onPatched();
|
|
@@ -500,9 +500,9 @@ var mountOptions = {
|
|
|
500
500
|
}
|
|
501
501
|
const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
|
|
502
502
|
if (shouldClearCache) {
|
|
503
|
-
await
|
|
503
|
+
await _chunk63LJ4WHFjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
504
504
|
}
|
|
505
|
-
const recorder =
|
|
505
|
+
const recorder = _chunk63LJ4WHFjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
|
|
506
506
|
source: "cli",
|
|
507
507
|
cwd: ctx.cwd,
|
|
508
508
|
recordTarget: shouldRecordTarget,
|
|
@@ -511,7 +511,7 @@ var mountOptions = {
|
|
|
511
511
|
if (_optionalChain([recorder, 'optionalAccess', _18 => _18.message])) {
|
|
512
512
|
_chunkJ4MI4EJOjs.logger.info(recorder.message);
|
|
513
513
|
}
|
|
514
|
-
|
|
514
|
+
_chunk63LJ4WHFjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
|
|
515
515
|
await patcher.patch();
|
|
516
516
|
if (_optionalChain([recorder, 'optionalAccess', _19 => _19.onPatched])) {
|
|
517
517
|
const recordPath = await recorder.onPatched();
|
|
@@ -659,9 +659,9 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
659
659
|
|
|
660
660
|
// src/cli.ts
|
|
661
661
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
662
|
-
if (_semver2.default.lt(_process2.default.versions.node,
|
|
662
|
+
if (_semver2.default.lt(_process2.default.versions.node, _chunk63LJ4WHFjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
663
663
|
_chunkJ4MI4EJOjs.logger.warn(
|
|
664
|
-
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${
|
|
664
|
+
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunk63LJ4WHFjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
665
665
|
);
|
|
666
666
|
}
|
|
667
667
|
var cli = _tailwindcsspatch.createTailwindcssPatchCli.call(void 0, {
|
package/dist/cli.mjs
CHANGED
package/dist/core.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
|
|
9
9
|
require('./chunk-J4MI4EJO.js');
|
|
10
10
|
require('./chunk-3URI7W6X.js');
|
|
11
11
|
require('./chunk-UW3WHSZ5.js');
|
|
@@ -15,9 +15,9 @@ require('./chunk-MB4BR57E.js');
|
|
|
15
15
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
16
16
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
17
17
|
function createContext(options = {}) {
|
|
18
|
-
const opts =
|
|
18
|
+
const opts = _chunk63LJ4WHFjs.getCompilerContext.call(void 0, options);
|
|
19
19
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
20
|
-
const patchRecorderState =
|
|
20
|
+
const patchRecorderState = _chunk477TX4LMjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
21
21
|
source: "runtime",
|
|
22
22
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
23
23
|
});
|
|
@@ -29,7 +29,7 @@ function createContext(options = {}) {
|
|
|
29
29
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
30
30
|
};
|
|
31
31
|
async function refreshRuntimeState(force) {
|
|
32
|
-
await
|
|
32
|
+
await _chunk63LJ4WHFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
33
33
|
}
|
|
34
34
|
async function transformWxss(rawCss, options2) {
|
|
35
35
|
await runtimeState.patchPromise;
|
|
@@ -38,7 +38,7 @@ function createContext(options = {}) {
|
|
|
38
38
|
}));
|
|
39
39
|
await refreshRuntimeState(true);
|
|
40
40
|
await runtimeState.patchPromise;
|
|
41
|
-
runtimeSet = await
|
|
41
|
+
runtimeSet = await _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
async function transformJs(rawJs, options2 = {}) {
|
|
@@ -48,7 +48,7 @@ function createContext(options = {}) {
|
|
|
48
48
|
} else {
|
|
49
49
|
await refreshRuntimeState(true);
|
|
50
50
|
await runtimeState.patchPromise;
|
|
51
|
-
runtimeSet = await
|
|
51
|
+
runtimeSet = await _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
52
52
|
}
|
|
53
53
|
return await jsHandler(rawJs, runtimeSet, options2);
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ function createContext(options = {}) {
|
|
|
57
57
|
if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
|
|
58
58
|
await refreshRuntimeState(true);
|
|
59
59
|
await runtimeState.patchPromise;
|
|
60
|
-
runtimeSet = await
|
|
60
|
+
runtimeSet = await _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
61
61
|
}
|
|
62
62
|
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
|
|
63
63
|
runtimeSet
|
package/dist/core.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setupPatchRecorder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7UAU27KZ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
collectRuntimeClassSet,
|
|
6
6
|
getCompilerContext,
|
|
7
7
|
refreshTailwindRuntimeState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZC5JYOAR.mjs";
|
|
9
9
|
import "./chunk-3VIPMWAG.mjs";
|
|
10
10
|
import "./chunk-QF65JGNW.mjs";
|
|
11
11
|
import "./chunk-ZNKIYZRQ.mjs";
|
package/dist/gulp.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkL3AOBWDWjs = require('./chunk-L3AOBWDW.js');
|
|
4
4
|
require('./chunk-LTJQUORK.js');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-477TX4LM.js');
|
|
6
|
+
require('./chunk-63LJ4WHF.js');
|
|
7
7
|
require('./chunk-J4MI4EJO.js');
|
|
8
8
|
require('./chunk-3URI7W6X.js');
|
|
9
9
|
require('./chunk-UW3WHSZ5.js');
|
|
10
10
|
require('./chunk-MB4BR57E.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createPlugins =
|
|
13
|
+
exports.createPlugins = _chunkL3AOBWDWjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EKF3ABRO.mjs";
|
|
4
4
|
import "./chunk-RRHPTTCP.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-7UAU27KZ.mjs";
|
|
6
|
+
import "./chunk-ZC5JYOAR.mjs";
|
|
7
7
|
import "./chunk-3VIPMWAG.mjs";
|
|
8
8
|
import "./chunk-QF65JGNW.mjs";
|
|
9
9
|
import "./chunk-ZNKIYZRQ.mjs";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createPlugins } from './gulp.mjs';
|
|
2
|
-
export { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions } from './types.mjs';
|
|
2
|
+
export { AppType, CreateJsHandlerOptions, DisabledOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions } from './types.mjs';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.mjs';
|
|
4
4
|
export { UnifiedWebpackPluginV5, weappTailwindcssPackageDir } from './webpack.mjs';
|
|
5
5
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createPlugins } from './gulp.js';
|
|
2
|
-
export { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions } from './types.js';
|
|
2
|
+
export { AppType, CreateJsHandlerOptions, DisabledOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions } from './types.js';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.js';
|
|
4
4
|
export { UnifiedWebpackPluginV5, weappTailwindcssPackageDir } from './webpack.js';
|
|
5
5
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunk2AWOAQD3js = require('./chunk-2AWOAQD3.js');
|
|
6
|
+
require('./chunk-6VSFN3NA.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkL3AOBWDWjs = require('./chunk-L3AOBWDW.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkML4F4ZPYjs = require('./chunk-ML4F4ZPY.js');
|
|
13
|
+
require('./chunk-ORSWL3MI.js');
|
|
14
14
|
require('./chunk-LTJQUORK.js');
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-477TX4LM.js');
|
|
16
|
+
require('./chunk-63LJ4WHF.js');
|
|
17
17
|
require('./chunk-J4MI4EJO.js');
|
|
18
18
|
require('./chunk-3URI7W6X.js');
|
|
19
19
|
require('./chunk-UW3WHSZ5.js');
|
|
@@ -23,4 +23,4 @@ require('./chunk-MB4BR57E.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
26
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkML4F4ZPYjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunk2AWOAQD3js.UnifiedWebpackPluginV5; exports.createPlugins = _chunkL3AOBWDWjs.createPlugins; exports.weappTailwindcssPackageDir = _chunk2AWOAQD3js.weappTailwindcssPackageDir;
|