weapp-tailwindcss 4.10.0-beta.2 → 4.10.0-beta.3
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-GFJYJ6WV.js → chunk-2BHX22WT.js} +27 -27
- package/dist/{chunk-D3I6GQUV.mjs → chunk-2VVKFR3W.mjs} +13 -3
- package/dist/{chunk-YS2V3XY2.js → chunk-4EMVQ5H2.js} +15 -15
- package/dist/{chunk-3RGU475C.js → chunk-5APD2MNV.js} +163 -77
- package/dist/{chunk-UCDOKKRH.js → chunk-AAVDJYEE.js} +24 -14
- package/dist/{chunk-F7FBGRWS.js → chunk-NDRBH7DO.js} +7 -7
- package/dist/{chunk-AGF55OIE.mjs → chunk-PBA2SZ3H.mjs} +2 -2
- package/dist/{chunk-FIJF6OL7.mjs → chunk-Q6NT6TZQ.mjs} +2 -2
- package/dist/{chunk-7D27E7TU.mjs → chunk-QOTLDKI4.mjs} +131 -45
- package/dist/{chunk-QOWSZHYT.js → chunk-RHQJLGBF.js} +3 -3
- package/dist/{chunk-2KAM7AAG.mjs → chunk-SLXV5ZYJ.mjs} +2 -2
- package/dist/{chunk-Q7TIBSU2.mjs → chunk-TIZBA67F.mjs} +1 -1
- package/dist/{chunk-7ATL22KK.mjs → chunk-TYYAOYEJ.mjs} +3 -3
- package/dist/{chunk-FLJBD5TW.js → chunk-VEJYEJ4V.js} +5 -5
- package/dist/cli.js +45 -45
- package/dist/cli.mjs +9 -9
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +8 -8
- package/dist/core.mjs +3 -3
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +4 -4
- package/dist/{index-vGuAfNvT.d.mts → index-v0opId0x.d.mts} +1 -1
- package/dist/{index-vGuAfNvT.d.ts → index-v0opId0x.d.ts} +1 -1
- 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/presets.d.mts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +8 -8
- package/dist/presets.mjs +5 -5
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +5 -5
- package/dist/vite.mjs +4 -4
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +6 -6
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +27 -27
- package/dist/webpack4.mjs +4 -4
- package/package.json +3 -3
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkRHQJLGBFjs = require('./chunk-RHQJLGBF.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -23,14 +23,14 @@ var _chunkIIDSY4XZjs = require('./chunk-IIDSY4XZ.js');
|
|
|
23
23
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkVEJYEJ4Vjs = require('./chunk-VEJYEJ4V.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkAAVDJYEEjs = require('./chunk-AAVDJYEE.js');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -51,10 +51,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
51
51
|
} = options;
|
|
52
52
|
const { Compilation, sources } = compiler.webpack;
|
|
53
53
|
const { ConcatSource } = sources;
|
|
54
|
-
compiler.hooks.compilation.tap(
|
|
54
|
+
compiler.hooks.compilation.tap(_chunkAAVDJYEEjs.pluginName, (compilation) => {
|
|
55
55
|
compilation.hooks.processAssets.tapPromise(
|
|
56
56
|
{
|
|
57
|
-
name:
|
|
57
|
+
name: _chunkAAVDJYEEjs.pluginName,
|
|
58
58
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
59
59
|
},
|
|
60
60
|
async (assets) => {
|
|
@@ -66,7 +66,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
66
66
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const assetHashByChunk =
|
|
69
|
+
const assetHashByChunk = _chunkRHQJLGBFjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
70
70
|
const entries = Object.entries(assets);
|
|
71
71
|
const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
|
|
72
72
|
const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
|
|
@@ -122,7 +122,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
125
|
-
const runtimeSet = await
|
|
125
|
+
const runtimeSet = await _chunkAAVDJYEEjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
126
126
|
forceCollect: false,
|
|
127
127
|
allowEmpty: false
|
|
128
128
|
});
|
|
@@ -165,7 +165,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
165
165
|
const jsTaskFactories = [];
|
|
166
166
|
if (Array.isArray(groupedEntries.js)) {
|
|
167
167
|
for (const [file] of groupedEntries.js) {
|
|
168
|
-
const cacheKey =
|
|
168
|
+
const cacheKey = _chunkRHQJLGBFjs.getCacheKey.call(void 0, file);
|
|
169
169
|
const asset = compilation.getAsset(file);
|
|
170
170
|
if (!asset) {
|
|
171
171
|
continue;
|
|
@@ -276,9 +276,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
276
276
|
getClassSetInLoader,
|
|
277
277
|
debug: debug2
|
|
278
278
|
} = options;
|
|
279
|
-
const isMpxApp =
|
|
279
|
+
const isMpxApp = _chunkRHQJLGBFjs.isMpx.call(void 0, appType);
|
|
280
280
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
281
|
-
|
|
281
|
+
_chunkRHQJLGBFjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
282
282
|
}
|
|
283
283
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
284
284
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -291,12 +291,12 @@ function setupWebpackV5Loaders(options) {
|
|
|
291
291
|
const classSetLoaderOptions = {
|
|
292
292
|
getClassSet: getClassSetInLoader
|
|
293
293
|
};
|
|
294
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
294
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkRHQJLGBFjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
295
295
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
296
296
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
297
297
|
} : void 0;
|
|
298
298
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
299
|
-
|
|
299
|
+
_chunkRHQJLGBFjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
300
300
|
}
|
|
301
301
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
302
302
|
loader: runtimeClassSetLoader,
|
|
@@ -316,17 +316,17 @@ function setupWebpackV5Loaders(options) {
|
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
318
|
const { NormalModule } = compiler.webpack;
|
|
319
|
-
compiler.hooks.compilation.tap(
|
|
320
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
319
|
+
compiler.hooks.compilation.tap(_chunkAAVDJYEEjs.pluginName, (compilation) => {
|
|
320
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkAAVDJYEEjs.pluginName, (_loaderContext, module) => {
|
|
321
321
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
322
322
|
if (!hasRuntimeLoader) {
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
_chunkRHQJLGBFjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
326
326
|
const loaderEntries = module.loaders || [];
|
|
327
327
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
328
328
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
329
|
-
const isCssModule =
|
|
329
|
+
const isCssModule = _chunkRHQJLGBFjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
330
330
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
331
331
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
332
332
|
}
|
|
@@ -358,7 +358,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
358
358
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
if (runtimeClassSetLoaderExists && !
|
|
361
|
+
if (runtimeClassSetLoaderExists && !_chunkRHQJLGBFjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
362
362
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
363
363
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
364
364
|
if (anchorIndex === -1) {
|
|
@@ -373,11 +373,11 @@ function setupWebpackV5Loaders(options) {
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
376
|
-
var debug =
|
|
376
|
+
var debug = _chunkAAVDJYEEjs.createDebug.call(void 0, );
|
|
377
377
|
var weappTailwindcssPackageDir = _chunkIIDSY4XZjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
378
378
|
var UnifiedWebpackPluginV5 = class {
|
|
379
379
|
constructor(options = {}) {
|
|
380
|
-
this.options =
|
|
380
|
+
this.options = _chunkAAVDJYEEjs.getCompilerContext.call(void 0, options);
|
|
381
381
|
this.appType = this.options.appType;
|
|
382
382
|
}
|
|
383
383
|
apply(compiler) {
|
|
@@ -393,19 +393,19 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
393
393
|
const disabledOptions = _chunkIIDSY4XZjs.resolveDisabledOptions.call(void 0, disabled);
|
|
394
394
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
395
395
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
396
|
-
const isMpxApp =
|
|
396
|
+
const isMpxApp = _chunkRHQJLGBFjs.isMpx.call(void 0, this.appType);
|
|
397
397
|
if (shouldRewriteCssImports) {
|
|
398
|
-
|
|
398
|
+
_chunkRHQJLGBFjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
399
399
|
pkgDir: weappTailwindcssPackageDir,
|
|
400
400
|
enabled: true,
|
|
401
401
|
appType: this.appType
|
|
402
402
|
});
|
|
403
|
-
|
|
403
|
+
_chunkRHQJLGBFjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
404
404
|
}
|
|
405
405
|
if (disabledOptions.plugin) {
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const patchRecorderState =
|
|
408
|
+
const patchRecorderState = _chunkVEJYEJ4Vjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
409
409
|
source: "runtime",
|
|
410
410
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
411
411
|
});
|
|
@@ -421,18 +421,18 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
421
421
|
runtimeSetPrepared = false;
|
|
422
422
|
};
|
|
423
423
|
if (_optionalChain([compiler, 'access', _13 => _13.hooks, 'access', _14 => _14.thisCompilation, 'optionalAccess', _15 => _15.tap])) {
|
|
424
|
-
compiler.hooks.thisCompilation.tap(
|
|
424
|
+
compiler.hooks.thisCompilation.tap(_chunkAAVDJYEEjs.pluginName, resetRuntimePreparation);
|
|
425
425
|
} else if (_optionalChain([compiler, 'access', _16 => _16.hooks, 'access', _17 => _17.compilation, 'optionalAccess', _18 => _18.tap])) {
|
|
426
|
-
compiler.hooks.compilation.tap(
|
|
426
|
+
compiler.hooks.compilation.tap(_chunkAAVDJYEEjs.pluginName, resetRuntimePreparation);
|
|
427
427
|
}
|
|
428
428
|
async function getClassSetInLoader() {
|
|
429
429
|
if (runtimeSetPrepared) {
|
|
430
430
|
return;
|
|
431
431
|
}
|
|
432
|
-
const signature =
|
|
432
|
+
const signature = _chunkAAVDJYEEjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
433
433
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
434
434
|
runtimeSetPrepared = true;
|
|
435
|
-
await
|
|
435
|
+
await _chunkAAVDJYEEjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
436
436
|
forceRefresh,
|
|
437
437
|
forceCollect: true,
|
|
438
438
|
clearCache: forceRefresh,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createTailwindcssPatcherFromContext,
|
|
4
4
|
findNearestPackageRoot,
|
|
5
5
|
warnMissingCssEntries
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QOTLDKI4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getDefaultOptions
|
|
9
9
|
} from "./chunk-EGOFMIDI.mjs";
|
|
@@ -266,7 +266,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
266
266
|
// package.json
|
|
267
267
|
var package_default = {
|
|
268
268
|
name: "weapp-tailwindcss",
|
|
269
|
-
version: "4.10.0-beta.
|
|
269
|
+
version: "4.10.0-beta.3",
|
|
270
270
|
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!",
|
|
271
271
|
author: "ice breaker <1324318532@qq.com>",
|
|
272
272
|
license: "MIT",
|
|
@@ -461,7 +461,7 @@ var package_default = {
|
|
|
461
461
|
"@babel/parser": "~7.29.0",
|
|
462
462
|
"@babel/traverse": "~7.29.0",
|
|
463
463
|
"@babel/types": "~7.29.0",
|
|
464
|
-
"@tailwindcss-mangle/config": "^6.1.
|
|
464
|
+
"@tailwindcss-mangle/config": "^6.1.1",
|
|
465
465
|
"@vue/compiler-dom": "catalog:vue3",
|
|
466
466
|
"@vue/compiler-sfc": "catalog:vue3",
|
|
467
467
|
"@weapp-core/escape": "~7.0.0",
|
|
@@ -2945,6 +2945,16 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
2945
2945
|
if (cacheOptions == null || typeof cacheOptions === "object" && cacheOptions.enabled === false) {
|
|
2946
2946
|
return;
|
|
2947
2947
|
}
|
|
2948
|
+
if (typeof patcher.clearCache === "function") {
|
|
2949
|
+
try {
|
|
2950
|
+
await patcher.clearCache({ scope: "all" });
|
|
2951
|
+
} catch (error) {
|
|
2952
|
+
logger5.debug("failed to clear tailwindcss patcher cache via clearCache(): %O", error);
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
if (!options?.removeDirectory) {
|
|
2956
|
+
return;
|
|
2957
|
+
}
|
|
2948
2958
|
const cachePaths = /* @__PURE__ */ new Map();
|
|
2949
2959
|
const normalizedCacheOptions = typeof cacheOptions === "object" ? cacheOptions : void 0;
|
|
2950
2960
|
if (normalizedCacheOptions?.path) {
|
|
@@ -12,7 +12,7 @@ var _chunkIIDSY4XZjs = require('./chunk-IIDSY4XZ.js');
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkVEJYEJ4Vjs = require('./chunk-VEJYEJ4V.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ var _chunkFLJBD5TWjs = require('./chunk-FLJBD5TW.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkAAVDJYEEjs = require('./chunk-AAVDJYEE.js');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -54,7 +54,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
54
54
|
const start = prop.value.loc.start.offset + 1;
|
|
55
55
|
const end = prop.value.loc.end.offset - 1;
|
|
56
56
|
if (start < end) {
|
|
57
|
-
ms.update(start, end,
|
|
57
|
+
ms.update(start, end, _chunkAAVDJYEEjs.replaceWxml.call(void 0, prop.value.content));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -66,7 +66,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
66
66
|
if (start >= end) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const generated =
|
|
69
|
+
const generated = _chunkAAVDJYEEjs.generateCode.call(void 0, prop.exp.content, {
|
|
70
70
|
jsHandler,
|
|
71
71
|
runtimeSet,
|
|
72
72
|
wrapExpression: true
|
|
@@ -95,7 +95,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
98
|
-
const matchCustomAttribute =
|
|
98
|
+
const matchCustomAttribute = _chunkAAVDJYEEjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
99
99
|
const ms = new (0, _magicstring2.default)(code);
|
|
100
100
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
101
101
|
if (errors.length === 0) {
|
|
@@ -721,7 +721,7 @@ function createGenerateBundleHook(context) {
|
|
|
721
721
|
const runtime = await ensureRuntimeClassSet(forceRuntimeRefresh);
|
|
722
722
|
metrics.runtimeSet = measureElapsed(runtimeStart);
|
|
723
723
|
debug2("get runtimeSet, class count: %d", runtime.size);
|
|
724
|
-
const runtimeSignature = _nullishCoalesce(
|
|
724
|
+
const runtimeSignature = _nullishCoalesce(_chunkAAVDJYEEjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher), () => ( "runtime:missing"));
|
|
725
725
|
const handleLinkedUpdate = (fileName, previous, next) => {
|
|
726
726
|
onUpdate(fileName, previous, next);
|
|
727
727
|
debug2("js linked handle: %s", fileName);
|
|
@@ -1028,7 +1028,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1028
1028
|
const { appType, weappTailwindcssDirPosix: weappTailwindcssDirPosix2 } = options;
|
|
1029
1029
|
return [
|
|
1030
1030
|
{
|
|
1031
|
-
name: `${
|
|
1031
|
+
name: `${_chunkAAVDJYEEjs.vitePluginName}:rewrite-css-imports`,
|
|
1032
1032
|
enforce: "pre",
|
|
1033
1033
|
resolveId: {
|
|
1034
1034
|
order: "pre",
|
|
@@ -1070,12 +1070,12 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
|
|
1072
1072
|
// src/bundlers/vite/index.ts
|
|
1073
|
-
var debug =
|
|
1073
|
+
var debug = _chunkAAVDJYEEjs.createDebug.call(void 0, );
|
|
1074
1074
|
var weappTailwindcssPackageDir = _chunkIIDSY4XZjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
1075
1075
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
1076
1076
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
1077
1077
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
1078
|
-
const opts =
|
|
1078
|
+
const opts = _chunkAAVDJYEEjs.getCompilerContext.call(void 0, options);
|
|
1079
1079
|
const {
|
|
1080
1080
|
disabled,
|
|
1081
1081
|
customAttributes,
|
|
@@ -1100,8 +1100,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1100
1100
|
if (disabledOptions.plugin) {
|
|
1101
1101
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
1102
1102
|
}
|
|
1103
|
-
const customAttributesEntities =
|
|
1104
|
-
const patchRecorderState =
|
|
1103
|
+
const customAttributesEntities = _chunkAAVDJYEEjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
1104
|
+
const patchRecorderState = _chunkVEJYEJ4Vjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
1105
1105
|
source: "runtime",
|
|
1106
1106
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
1107
1107
|
});
|
|
@@ -1118,7 +1118,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1118
1118
|
let runtimeRefreshOptionsKey;
|
|
1119
1119
|
function resolveRuntimeRefreshOptions() {
|
|
1120
1120
|
const configPath = _optionalChain([runtimeState, 'access', _29 => _29.twPatcher, 'access', _30 => _30.options, 'optionalAccess', _31 => _31.tailwind, 'optionalAccess', _32 => _32.config]);
|
|
1121
|
-
const signature =
|
|
1121
|
+
const signature = _chunkAAVDJYEEjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
1122
1122
|
const optionsKey = JSON.stringify({
|
|
1123
1123
|
appType,
|
|
1124
1124
|
uniAppX: Boolean(uniAppX),
|
|
@@ -1139,7 +1139,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1139
1139
|
async function refreshRuntimeState(force) {
|
|
1140
1140
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
1141
1141
|
const shouldRefresh = force || invalidation.changed;
|
|
1142
|
-
const refreshed = await
|
|
1142
|
+
const refreshed = await _chunkAAVDJYEEjs.refreshTailwindRuntimeState.call(void 0, runtimeState, {
|
|
1143
1143
|
force: shouldRefresh,
|
|
1144
1144
|
clearCache: force || invalidation.changed
|
|
1145
1145
|
});
|
|
@@ -1160,7 +1160,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
if (forceRuntimeRefresh || !runtimeSetPromise) {
|
|
1162
1162
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
1163
|
-
const task2 =
|
|
1163
|
+
const task2 = _chunkAAVDJYEEjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
1164
1164
|
force: forceRuntimeRefresh || invalidation.changed,
|
|
1165
1165
|
skipRefresh: forceRuntimeRefresh,
|
|
1166
1166
|
clearCache: forceRuntimeRefresh || invalidation.changed
|
|
@@ -1196,7 +1196,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1196
1196
|
const plugins = [
|
|
1197
1197
|
...rewritePlugins,
|
|
1198
1198
|
{
|
|
1199
|
-
name: `${
|
|
1199
|
+
name: `${_chunkAAVDJYEEjs.vitePluginName}:post`,
|
|
1200
1200
|
enforce: "post",
|
|
1201
1201
|
configResolved(config) {
|
|
1202
1202
|
resolvedConfig = config;
|