weapp-tailwindcss 4.7.8 → 4.7.9
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-6NAX73ZA.mjs → chunk-BLSNFAO7.mjs} +2 -2
- package/dist/{chunk-DMJK47DW.mjs → chunk-BTPDRSHI.mjs} +1 -1
- package/dist/{chunk-GCF5VD66.js → chunk-DTBKYR3J.js} +11 -11
- package/dist/{chunk-6J63FRIY.js → chunk-HPVYHFXX.js} +3 -3
- package/dist/{chunk-OQ5PKCFN.mjs → chunk-JBZ63WDH.mjs} +1 -1
- package/dist/{chunk-HPUZNQ4G.js → chunk-KMCQEHJM.js} +17 -14
- package/dist/{chunk-ZSTADQDZ.js → chunk-RIMKL2AV.js} +10 -10
- package/dist/{chunk-LJ5AQYTF.js → chunk-SMEWY6FJ.js} +6 -6
- package/dist/{chunk-G7MXWOBI.mjs → chunk-TPBIR7NL.mjs} +1 -1
- package/dist/{chunk-6HQQYIBT.mjs → chunk-WSMHVHT4.mjs} +1 -1
- package/dist/{chunk-UCPNYFTI.js → chunk-XGRBCPBI.js} +1 -1
- package/dist/{chunk-SHMBWMDV.mjs → chunk-YW5YW5D4.mjs} +13 -10
- package/dist/cli.js +12 -12
- package/dist/cli.mjs +3 -3
- package/dist/core.js +9 -9
- package/dist/core.mjs +3 -3
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +4 -4
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +3 -3
- package/dist/presets.mjs +2 -2
- package/dist/types.d.mts +25 -25
- package/dist/types.d.ts +25 -25
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +5 -5
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +12 -12
- package/dist/webpack4.mjs +3 -3
- package/package.json +4 -4
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
getCompilerContext,
|
|
17
17
|
pluginName,
|
|
18
18
|
refreshTailwindRuntimeState
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TPBIR7NL.mjs";
|
|
20
20
|
import {
|
|
21
21
|
getGroupedEntries
|
|
22
22
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
23
23
|
import {
|
|
24
24
|
__dirname
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-BTPDRSHI.mjs";
|
|
26
26
|
|
|
27
27
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
28
28
|
import fs from "fs";
|
|
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.2_@swc+h_714fe42112a7ecb62f8dfb6a41f9e513/node_modules/tsup/assets/esm_shims.js
|
|
9
9
|
import path from "path";
|
|
10
10
|
import { fileURLToPath } from "url";
|
|
11
11
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -17,7 +17,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkHPVYHFXXjs = require('./chunk-HPVYHFXX.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -49,7 +49,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
49
49
|
const start = prop.value.loc.start.offset + 1;
|
|
50
50
|
const end = prop.value.loc.end.offset - 1;
|
|
51
51
|
if (start < end) {
|
|
52
|
-
ms.update(start, end,
|
|
52
|
+
ms.update(start, end, _chunkHPVYHFXXjs.replaceWxml.call(void 0, prop.value.content));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -61,7 +61,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
61
61
|
if (start >= end) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const generated =
|
|
64
|
+
const generated = _chunkHPVYHFXXjs.generateCode.call(void 0, prop.exp.content, {
|
|
65
65
|
jsHandler,
|
|
66
66
|
runtimeSet,
|
|
67
67
|
wrapExpression: true
|
|
@@ -90,7 +90,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
93
|
-
const matchCustomAttribute =
|
|
93
|
+
const matchCustomAttribute = _chunkHPVYHFXXjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
94
94
|
const ms = new (0, _magicstring2.default)(code);
|
|
95
95
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
96
96
|
if (errors.length === 0) {
|
|
@@ -213,7 +213,7 @@ async function formatPostcssSourceMap(rawMap, file) {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// src/bundlers/vite/index.ts
|
|
216
|
-
var debug =
|
|
216
|
+
var debug = _chunkHPVYHFXXjs.createDebug.call(void 0, );
|
|
217
217
|
function readOutputEntry(entry) {
|
|
218
218
|
if (entry.output.type === "chunk") {
|
|
219
219
|
return entry.output.code;
|
|
@@ -280,7 +280,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
283
|
-
const opts =
|
|
283
|
+
const opts = _chunkHPVYHFXXjs.getCompilerContext.call(void 0, options);
|
|
284
284
|
const {
|
|
285
285
|
disabled,
|
|
286
286
|
customAttributes,
|
|
@@ -302,17 +302,17 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
302
302
|
if (disabled) {
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
const customAttributesEntities =
|
|
305
|
+
const customAttributesEntities = _chunkHPVYHFXXjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
306
306
|
const runtimeState = {
|
|
307
307
|
twPatcher: initialTwPatcher,
|
|
308
|
-
patchPromise:
|
|
308
|
+
patchPromise: _chunkHPVYHFXXjs.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
309
309
|
refreshTailwindcssPatcher
|
|
310
310
|
};
|
|
311
311
|
let runtimeSet;
|
|
312
312
|
let runtimeSetPromise;
|
|
313
313
|
let resolvedConfig;
|
|
314
314
|
async function refreshRuntimeState(force) {
|
|
315
|
-
const refreshed = await
|
|
315
|
+
const refreshed = await _chunkHPVYHFXXjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
316
316
|
if (refreshed) {
|
|
317
317
|
runtimeSet = void 0;
|
|
318
318
|
runtimeSetPromise = void 0;
|
|
@@ -325,7 +325,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
325
325
|
return runtimeSet;
|
|
326
326
|
}
|
|
327
327
|
if (force || !runtimeSetPromise) {
|
|
328
|
-
const task2 =
|
|
328
|
+
const task2 = _chunkHPVYHFXXjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
329
329
|
force: force || !runtimeSet,
|
|
330
330
|
skipRefresh: force
|
|
331
331
|
});
|
|
@@ -344,7 +344,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
344
344
|
onLoad();
|
|
345
345
|
const plugins = [
|
|
346
346
|
{
|
|
347
|
-
name: `${
|
|
347
|
+
name: `${_chunkHPVYHFXXjs.vitePluginName}:post`,
|
|
348
348
|
enforce: "post",
|
|
349
349
|
configResolved(config) {
|
|
350
350
|
resolvedConfig = config;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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 _chunkKMCQEHJMjs = require('./chunk-KMCQEHJM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkSMYOFNHJjs = require('./chunk-SMYOFNHJ.js');
|
|
@@ -2305,7 +2305,7 @@ function getCompilerContext(opts) {
|
|
|
2305
2305
|
);
|
|
2306
2306
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2307
2307
|
applyLoggerLevel(ctx.logLevel);
|
|
2308
|
-
const twPatcher =
|
|
2308
|
+
const twPatcher = _chunkKMCQEHJMjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2309
2309
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
2310
2310
|
if (_optionalChain([twPatcher, 'access', _82 => _82.packageInfo, 'optionalAccess', _83 => _83.version])) {
|
|
2311
2311
|
_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)))}`);
|
|
@@ -2335,7 +2335,7 @@ function getCompilerContext(opts) {
|
|
|
2335
2335
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2336
2336
|
}
|
|
2337
2337
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2338
|
-
const nextPatcher =
|
|
2338
|
+
const nextPatcher = _chunkKMCQEHJMjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2339
2339
|
Object.assign(previousPatcher, nextPatcher);
|
|
2340
2340
|
ctx.twPatcher = previousPatcher;
|
|
2341
2341
|
return previousPatcher;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkXGRBCPBIjs = require('./chunk-XGRBCPBI.js');
|
|
7
7
|
|
|
8
8
|
// src/context/tailwindcss.ts
|
|
9
9
|
var _module = require('module');
|
|
@@ -46,7 +46,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
46
46
|
return void 0;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const req = _module.createRequire.call(void 0,
|
|
49
|
+
const req = _module.createRequire.call(void 0, _chunkXGRBCPBIjs.importMetaUrl);
|
|
50
50
|
return req.resolve(specifier, { paths });
|
|
51
51
|
} catch (e) {
|
|
52
52
|
return void 0;
|
|
@@ -163,11 +163,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
163
163
|
const cwd = _process2.default.cwd();
|
|
164
164
|
appendNodeModules(paths, cwd);
|
|
165
165
|
try {
|
|
166
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
166
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkXGRBCPBIjs.importMetaUrl);
|
|
167
167
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
168
168
|
paths.add(candidate);
|
|
169
169
|
} catch (e2) {
|
|
170
|
-
paths.add(
|
|
170
|
+
paths.add(_chunkXGRBCPBIjs.importMetaUrl);
|
|
171
171
|
}
|
|
172
172
|
if (paths.size === 0) {
|
|
173
173
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -741,8 +741,7 @@ function createMultiTailwindcssPatcher(patchers) {
|
|
|
741
741
|
}
|
|
742
742
|
return multiPatcher;
|
|
743
743
|
}
|
|
744
|
-
function tryCreateMultiTailwindcssPatcher(
|
|
745
|
-
const groups = groupCssEntriesByBase(cssEntries);
|
|
744
|
+
function tryCreateMultiTailwindcssPatcher(groups, options) {
|
|
746
745
|
if (groups.size <= 1) {
|
|
747
746
|
return void 0;
|
|
748
747
|
}
|
|
@@ -769,25 +768,29 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
769
768
|
if (normalizedCssEntries) {
|
|
770
769
|
ctx.cssEntries = normalizedCssEntries;
|
|
771
770
|
}
|
|
772
|
-
const
|
|
771
|
+
const patcherOptions = {
|
|
773
772
|
tailwindcss,
|
|
774
773
|
tailwindcssPatcherOptions,
|
|
775
774
|
supportCustomLengthUnitsPatch,
|
|
776
775
|
appType
|
|
777
|
-
}
|
|
776
|
+
};
|
|
777
|
+
const groupedCssEntries = normalizedCssEntries ? groupCssEntriesByBase(normalizedCssEntries) : void 0;
|
|
778
|
+
const multiPatcher = groupedCssEntries ? tryCreateMultiTailwindcssPatcher(groupedCssEntries, patcherOptions) : void 0;
|
|
778
779
|
if (multiPatcher) {
|
|
779
780
|
return multiPatcher;
|
|
780
781
|
}
|
|
782
|
+
if (_optionalChain([groupedCssEntries, 'optionalAccess', _36 => _36.size]) === 1) {
|
|
783
|
+
const firstGroup = groupedCssEntries.entries().next().value;
|
|
784
|
+
if (firstGroup) {
|
|
785
|
+
const [baseDir, entries] = firstGroup;
|
|
786
|
+
return createPatcherForBase(baseDir, entries, patcherOptions);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
781
789
|
const effectiveCssEntries = _nullishCoalesce(normalizedCssEntries, () => ( rawCssEntries));
|
|
782
790
|
return createPatcherForBase(
|
|
783
791
|
resolvedTailwindcssBasedir,
|
|
784
792
|
effectiveCssEntries,
|
|
785
|
-
|
|
786
|
-
tailwindcss,
|
|
787
|
-
tailwindcssPatcherOptions,
|
|
788
|
-
supportCustomLengthUnitsPatch,
|
|
789
|
-
appType
|
|
790
|
-
}
|
|
793
|
+
patcherOptions
|
|
791
794
|
);
|
|
792
795
|
}
|
|
793
796
|
|
|
@@ -16,7 +16,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkHPVYHFXXjs = require('./chunk-HPVYHFXX.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -25,10 +25,10 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
|
25
25
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
26
26
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
27
27
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
28
|
-
var debug =
|
|
28
|
+
var debug = _chunkHPVYHFXXjs.createDebug.call(void 0, );
|
|
29
29
|
var UnifiedWebpackPluginV5 = class {
|
|
30
30
|
constructor(options = {}) {
|
|
31
|
-
this.options =
|
|
31
|
+
this.options = _chunkHPVYHFXXjs.getCompilerContext.call(void 0, options);
|
|
32
32
|
this.appType = this.options.appType;
|
|
33
33
|
}
|
|
34
34
|
apply(compiler) {
|
|
@@ -52,18 +52,18 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
52
52
|
}
|
|
53
53
|
const runtimeState = {
|
|
54
54
|
twPatcher: initialTwPatcher,
|
|
55
|
-
patchPromise:
|
|
55
|
+
patchPromise: _chunkHPVYHFXXjs.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
56
56
|
refreshTailwindcssPatcher
|
|
57
57
|
};
|
|
58
58
|
const refreshRuntimeState = async (force) => {
|
|
59
|
-
await
|
|
59
|
+
await _chunkHPVYHFXXjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
60
60
|
};
|
|
61
61
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
62
62
|
const { ConcatSource } = sources;
|
|
63
63
|
async function getClassSetInLoader() {
|
|
64
64
|
await refreshRuntimeState(true);
|
|
65
65
|
await runtimeState.patchPromise;
|
|
66
|
-
await
|
|
66
|
+
await _chunkHPVYHFXXjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
67
67
|
}
|
|
68
68
|
onLoad();
|
|
69
69
|
const loader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-loader.js")));
|
|
@@ -76,8 +76,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
76
76
|
ident: null,
|
|
77
77
|
type: null
|
|
78
78
|
};
|
|
79
|
-
compiler.hooks.compilation.tap(
|
|
80
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
79
|
+
compiler.hooks.compilation.tap(_chunkHPVYHFXXjs.pluginName, (compilation) => {
|
|
80
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkHPVYHFXXjs.pluginName, (_loaderContext, module) => {
|
|
81
81
|
if (isExisted) {
|
|
82
82
|
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
83
83
|
if (idx > -1) {
|
|
@@ -87,7 +87,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
87
87
|
});
|
|
88
88
|
compilation.hooks.processAssets.tapPromise(
|
|
89
89
|
{
|
|
90
|
-
name:
|
|
90
|
+
name: _chunkHPVYHFXXjs.pluginName,
|
|
91
91
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
92
92
|
},
|
|
93
93
|
async (assets) => {
|
|
@@ -156,7 +156,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
156
156
|
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
|
|
157
157
|
await refreshRuntimeState(true);
|
|
158
158
|
await runtimeState.patchPromise;
|
|
159
|
-
const runtimeSet = await
|
|
159
|
+
const runtimeSet = await _chunkHPVYHFXXjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
160
160
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
161
161
|
const tasks = [];
|
|
162
162
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -7,7 +7,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkHPVYHFXXjs = require('./chunk-HPVYHFXX.js');
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
var _buffer = require('buffer');
|
|
@@ -15,21 +15,21 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
15
15
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
16
16
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
17
17
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
18
|
-
var debug =
|
|
18
|
+
var debug = _chunkHPVYHFXXjs.createDebug.call(void 0, );
|
|
19
19
|
var Transform = _stream2.default.Transform;
|
|
20
20
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
21
|
+
const opts = _chunkHPVYHFXXjs.getCompilerContext.call(void 0, options);
|
|
22
22
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
23
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
24
24
|
const runtimeState = {
|
|
25
25
|
twPatcher: initialTwPatcher,
|
|
26
|
-
patchPromise:
|
|
26
|
+
patchPromise: _chunkHPVYHFXXjs.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
27
27
|
refreshTailwindcssPatcher
|
|
28
28
|
};
|
|
29
29
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
30
30
|
let runtimeSetInitialized = false;
|
|
31
31
|
async function refreshRuntimeState(force) {
|
|
32
|
-
await
|
|
32
|
+
await _chunkHPVYHFXXjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
33
33
|
}
|
|
34
34
|
async function refreshRuntimeSet(force = false) {
|
|
35
35
|
await refreshRuntimeState(force);
|
|
@@ -37,7 +37,7 @@ function createPlugins(options = {}) {
|
|
|
37
37
|
if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
|
|
38
38
|
return runtimeSet;
|
|
39
39
|
}
|
|
40
|
-
runtimeSet = await
|
|
40
|
+
runtimeSet = await _chunkHPVYHFXXjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
41
41
|
runtimeSetInitialized = true;
|
|
42
42
|
return runtimeSet;
|
|
43
43
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.2_@swc+h_714fe42112a7ecb62f8dfb6a41f9e513/node_modules/tsup/assets/cjs_shims.js
|
|
9
9
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
10
10
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
11
11
|
|
|
@@ -738,8 +738,7 @@ function createMultiTailwindcssPatcher(patchers) {
|
|
|
738
738
|
}
|
|
739
739
|
return multiPatcher;
|
|
740
740
|
}
|
|
741
|
-
function tryCreateMultiTailwindcssPatcher(
|
|
742
|
-
const groups = groupCssEntriesByBase(cssEntries);
|
|
741
|
+
function tryCreateMultiTailwindcssPatcher(groups, options) {
|
|
743
742
|
if (groups.size <= 1) {
|
|
744
743
|
return void 0;
|
|
745
744
|
}
|
|
@@ -766,25 +765,29 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
766
765
|
if (normalizedCssEntries) {
|
|
767
766
|
ctx.cssEntries = normalizedCssEntries;
|
|
768
767
|
}
|
|
769
|
-
const
|
|
768
|
+
const patcherOptions = {
|
|
770
769
|
tailwindcss,
|
|
771
770
|
tailwindcssPatcherOptions,
|
|
772
771
|
supportCustomLengthUnitsPatch,
|
|
773
772
|
appType
|
|
774
|
-
}
|
|
773
|
+
};
|
|
774
|
+
const groupedCssEntries = normalizedCssEntries ? groupCssEntriesByBase(normalizedCssEntries) : void 0;
|
|
775
|
+
const multiPatcher = groupedCssEntries ? tryCreateMultiTailwindcssPatcher(groupedCssEntries, patcherOptions) : void 0;
|
|
775
776
|
if (multiPatcher) {
|
|
776
777
|
return multiPatcher;
|
|
777
778
|
}
|
|
779
|
+
if (groupedCssEntries?.size === 1) {
|
|
780
|
+
const firstGroup = groupedCssEntries.entries().next().value;
|
|
781
|
+
if (firstGroup) {
|
|
782
|
+
const [baseDir, entries] = firstGroup;
|
|
783
|
+
return createPatcherForBase(baseDir, entries, patcherOptions);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
778
786
|
const effectiveCssEntries = normalizedCssEntries ?? rawCssEntries;
|
|
779
787
|
return createPatcherForBase(
|
|
780
788
|
resolvedTailwindcssBasedir,
|
|
781
789
|
effectiveCssEntries,
|
|
782
|
-
|
|
783
|
-
tailwindcss,
|
|
784
|
-
tailwindcssPatcherOptions,
|
|
785
|
-
supportCustomLengthUnitsPatch,
|
|
786
|
-
appType
|
|
787
|
-
}
|
|
790
|
+
patcherOptions
|
|
788
791
|
);
|
|
789
792
|
}
|
|
790
793
|
|
package/dist/cli.js
CHANGED
|
@@ -7,8 +7,8 @@ var _chunkOXASK55Qjs = require('./chunk-OXASK55Q.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
10
|
+
var _chunkHPVYHFXXjs = require('./chunk-HPVYHFXX.js');
|
|
11
|
+
require('./chunk-KMCQEHJM.js');
|
|
12
12
|
require('./chunk-SMYOFNHJ.js');
|
|
13
13
|
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkXGRBCPBIjs = require('./chunk-XGRBCPBI.js');
|
|
20
20
|
|
|
21
21
|
// src/cli.ts
|
|
22
22
|
var _promises = require('fs/promises');
|
|
@@ -34,12 +34,12 @@ function getNodeRequire() {
|
|
|
34
34
|
if (cachedRequire) {
|
|
35
35
|
return cachedRequire;
|
|
36
36
|
}
|
|
37
|
-
if (typeof
|
|
38
|
-
cachedRequire =
|
|
37
|
+
if (typeof _chunkXGRBCPBIjs.__require === "function") {
|
|
38
|
+
cachedRequire = _chunkXGRBCPBIjs.__require;
|
|
39
39
|
return cachedRequire;
|
|
40
40
|
}
|
|
41
41
|
try {
|
|
42
|
-
cachedRequire = _module.createRequire.call(void 0,
|
|
42
|
+
cachedRequire = _module.createRequire.call(void 0, _chunkXGRBCPBIjs.importMetaUrl);
|
|
43
43
|
} catch (e) {
|
|
44
44
|
cachedRequire = void 0;
|
|
45
45
|
}
|
|
@@ -124,7 +124,7 @@ function createCliContext(overrides, resolvedCwd) {
|
|
|
124
124
|
current
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
|
-
return
|
|
127
|
+
return _chunkHPVYHFXXjs.getCompilerContext.call(void 0, userOptions);
|
|
128
128
|
}
|
|
129
129
|
function formatOutputPath(target, baseDir) {
|
|
130
130
|
const root = _nullishCoalesce(baseDir, () => ( _process2.default.cwd()));
|
|
@@ -289,9 +289,9 @@ function logTokenPreview(report, format, groupKey) {
|
|
|
289
289
|
|
|
290
290
|
// src/cli.ts
|
|
291
291
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
292
|
-
if (_semver2.default.lt(_process2.default.versions.node,
|
|
292
|
+
if (_semver2.default.lt(_process2.default.versions.node, _chunkHPVYHFXXjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
293
293
|
_chunkOXASK55Qjs.logger.warn(
|
|
294
|
-
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${
|
|
294
|
+
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkHPVYHFXXjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
297
|
var cli = _cac2.default.call(void 0, "weapp-tailwindcss");
|
|
@@ -301,13 +301,13 @@ cli.command("patch", "Apply Tailwind CSS runtime patches").alias("install").opti
|
|
|
301
301
|
const ctx = createCliContext(void 0, resolvedCwd);
|
|
302
302
|
const shouldClearCache = toBoolean(options.clearCache, false);
|
|
303
303
|
if (shouldClearCache) {
|
|
304
|
-
await
|
|
304
|
+
await _chunkHPVYHFXXjs.clearTailwindcssPatcherCache.call(void 0, ctx.twPatcher, { removeDirectory: true });
|
|
305
305
|
}
|
|
306
|
-
|
|
306
|
+
_chunkHPVYHFXXjs.logTailwindcssTarget.call(void 0, "cli", ctx.twPatcher, ctx.tailwindcssBasedir);
|
|
307
307
|
await ctx.twPatcher.patch();
|
|
308
308
|
const shouldRecordTarget = toBoolean(options.recordTarget, false);
|
|
309
309
|
if (shouldRecordTarget) {
|
|
310
|
-
const recordPath = await
|
|
310
|
+
const recordPath = await _chunkHPVYHFXXjs.saveCliPatchTargetRecord.call(void 0, ctx.tailwindcssBasedir, ctx.twPatcher);
|
|
311
311
|
if (recordPath) {
|
|
312
312
|
_chunkOXASK55Qjs.logger.info(`\u8BB0\u5F55 weapp-tw patch \u76EE\u6807 -> ${formatOutputPath(recordPath, resolvedCwd)}`);
|
|
313
313
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
getCompilerContext,
|
|
8
8
|
logTailwindcssTarget,
|
|
9
9
|
saveCliPatchTargetRecord
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-TPBIR7NL.mjs";
|
|
11
|
+
import "./chunk-YW5YW5D4.mjs";
|
|
12
12
|
import "./chunk-PYXTMD6B.mjs";
|
|
13
13
|
import {
|
|
14
14
|
defuOverrideArray
|
|
15
15
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
16
16
|
import {
|
|
17
17
|
__require
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-BTPDRSHI.mjs";
|
|
19
19
|
|
|
20
20
|
// src/cli.ts
|
|
21
21
|
import { writeFile } from "fs/promises";
|
package/dist/core.js
CHANGED
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunkHPVYHFXXjs = require('./chunk-HPVYHFXX.js');
|
|
7
|
+
require('./chunk-KMCQEHJM.js');
|
|
8
8
|
require('./chunk-SMYOFNHJ.js');
|
|
9
9
|
require('./chunk-UW3WHSZ5.js');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-XGRBCPBI.js');
|
|
11
11
|
|
|
12
12
|
// src/core.ts
|
|
13
13
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
14
14
|
function createContext(options = {}) {
|
|
15
|
-
const opts =
|
|
15
|
+
const opts = _chunkHPVYHFXXjs.getCompilerContext.call(void 0, options);
|
|
16
16
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
17
17
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
18
18
|
const runtimeState = {
|
|
19
19
|
twPatcher: initialTwPatcher,
|
|
20
|
-
patchPromise:
|
|
20
|
+
patchPromise: _chunkHPVYHFXXjs.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
21
21
|
refreshTailwindcssPatcher
|
|
22
22
|
};
|
|
23
23
|
async function refreshRuntimeState(force) {
|
|
24
|
-
await
|
|
24
|
+
await _chunkHPVYHFXXjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
25
25
|
}
|
|
26
26
|
async function transformWxss(rawCss, options2) {
|
|
27
27
|
await runtimeState.patchPromise;
|
|
@@ -30,7 +30,7 @@ function createContext(options = {}) {
|
|
|
30
30
|
}));
|
|
31
31
|
await refreshRuntimeState(true);
|
|
32
32
|
await runtimeState.patchPromise;
|
|
33
|
-
runtimeSet = await
|
|
33
|
+
runtimeSet = await _chunkHPVYHFXXjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
34
34
|
return result;
|
|
35
35
|
}
|
|
36
36
|
async function transformJs(rawJs, options2 = {}) {
|
|
@@ -40,7 +40,7 @@ function createContext(options = {}) {
|
|
|
40
40
|
} else {
|
|
41
41
|
await refreshRuntimeState(true);
|
|
42
42
|
await runtimeState.patchPromise;
|
|
43
|
-
runtimeSet = await
|
|
43
|
+
runtimeSet = await _chunkHPVYHFXXjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
44
44
|
}
|
|
45
45
|
return await jsHandler(rawJs, runtimeSet, options2);
|
|
46
46
|
}
|
|
@@ -49,7 +49,7 @@ function createContext(options = {}) {
|
|
|
49
49
|
if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
|
|
50
50
|
await refreshRuntimeState(true);
|
|
51
51
|
await runtimeState.patchPromise;
|
|
52
|
-
runtimeSet = await
|
|
52
|
+
runtimeSet = await _chunkHPVYHFXXjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
53
53
|
}
|
|
54
54
|
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
|
|
55
55
|
runtimeSet
|
package/dist/core.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
createTailwindPatchPromise,
|
|
4
4
|
getCompilerContext,
|
|
5
5
|
refreshTailwindRuntimeState
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-TPBIR7NL.mjs";
|
|
7
|
+
import "./chunk-YW5YW5D4.mjs";
|
|
8
8
|
import "./chunk-PYXTMD6B.mjs";
|
|
9
9
|
import "./chunk-ZNKIYZRQ.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-BTPDRSHI.mjs";
|
|
11
11
|
|
|
12
12
|
// src/core.ts
|
|
13
13
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
package/dist/css-macro.js
CHANGED
|
@@ -5,7 +5,7 @@ var _chunkNS3NEDWDjs = require('./chunk-NS3NEDWD.js');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-XGRBCPBI.js');
|
|
9
9
|
|
|
10
10
|
// src/css-macro/index.ts
|
|
11
11
|
var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
|
package/dist/css-macro.mjs
CHANGED