weapp-tailwindcss 5.0.11 → 5.0.13
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/{bundle-state-BwtEqxvU.js → bundle-state-CKWeTEhv.js} +2 -40
- package/dist/{bundle-state-CXzPknlT.mjs → bundle-state-zQ2MrDdi.mjs} +2 -34
- package/dist/bundlers/gulp/vinyl-transform.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +7 -2
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +22 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +5 -22
- package/dist/bundlers/shared/generator-css/types.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/shared/hmr-timing.d.ts +1 -0
- package/dist/bundlers/vite/css-memory.d.ts +27 -0
- package/dist/bundlers/vite/generate-bundle/bundle-file-names.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +9 -7
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +58 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +31 -0
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +77 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +53 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime-linked-css.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +21 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +29 -0
- package/dist/bundlers/vite/generate-bundle/timing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +2 -1
- package/dist/bundlers/vite/hot-css-modules.d.ts +5 -0
- package/dist/bundlers/vite/map-cache.d.ts +2 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +16 -0
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -2
- package/dist/bundlers/vite/source-candidate-scan-signature.d.ts +13 -0
- package/dist/bundlers/vite/source-candidates.d.ts +9 -0
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +1 -0
- package/dist/bundlers/vite/source-scan.d.ts +1 -1
- package/dist/bundlers/vite/weapp-vite-config.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +11 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +2 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +5 -0
- package/dist/cache/index.d.ts +4 -0
- package/dist/cli.js +9 -2
- package/dist/cli.mjs +8 -1
- package/dist/core.d.ts +7 -0
- package/dist/core.js +8 -5
- package/dist/core.mjs +8 -5
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-DH0ZQRhy.mjs → defaults-Bqx18S1f.mjs} +2 -35
- package/dist/{defaults-Boc26eel.js → defaults-C_J_kBpw.js} +2 -35
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/framework/index.d.ts +59 -0
- package/dist/framework.d.ts +1 -0
- package/dist/framework.js +198 -0
- package/dist/framework.mjs +180 -0
- package/dist/{generator-ChgOWNOj.js → generator-CzpArpCL.js} +1 -1
- package/dist/{generator-h2XRiJ9-.mjs → generator-ITLd7PTl.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-Be88jhoY.mjs → gulp-DfOQERcV.mjs} +137 -23
- package/dist/{gulp-CHtZF-oT.js → gulp-XT8Jc7lH.js} +137 -23
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-BkivBZvN.js → hmr-timing-BMftW7Us.js} +354 -225
- package/dist/{hmr-timing-Ct5w4hdM.mjs → hmr-timing-DQIP_8qP.mjs} +341 -225
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -4
- package/dist/index.mjs +6 -5
- package/dist/postcss.js +9 -10
- package/dist/postcss.mjs +7 -5
- package/dist/{precheck-CY9oaH49.js → precheck-B0Z8yW7E.js} +108 -27
- package/dist/{precheck-BpHxsWRd.mjs → precheck-CRI90iL1.mjs} +109 -28
- package/dist/presets.js +3 -3
- package/dist/presets.mjs +3 -3
- package/dist/tailwindcss/source-scan.d.ts +1 -0
- package/dist/tailwindcss/v3-engine/generator.d.ts +17 -0
- package/dist/tailwindcss/v3-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v3-engine/types.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +19 -0
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/{tailwindcss-Bfy2egdX.mjs → tailwindcss-DTq3uYBK.mjs} +2 -2
- package/dist/{tailwindcss-DbbAKAZP.js → tailwindcss-DZEwT3C_.js} +3 -3
- package/dist/{transform-r5evL6Hn.mjs → transform-DfcEjsZF.mjs} +29 -21
- package/dist/{transform-Cd634UZV.js → transform-YmrmxuF3.js} +29 -21
- package/dist/types/user-defined-options/general.d.ts +3 -1
- package/dist/{utils-Dolmt8EO.js → utils-BCa37Wqj.js} +2 -17
- package/dist/{utils-DsaS975I.mjs → utils-DodxWHGz.mjs} +2 -17
- package/dist/{v3-engine-D0yA9ZkF.js → v3-engine-2rrgylhn.js} +194 -34
- package/dist/{v3-engine-CFkP6dWF.mjs → v3-engine-C6eJ0YzK.mjs} +176 -34
- package/dist/{vite-j9cB2Ff1.js → vite-CXHVsHmX.js} +2071 -1160
- package/dist/{vite-Bd8qf9dK.mjs → vite-DjI09vVN.mjs} +2071 -1160
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +476 -217
- package/dist/weapp-tw-runtime-classset-loader.js +25 -0
- package/dist/{webpack-DPdrcC2X.mjs → webpack-BcPpnT90.mjs} +251 -40
- package/dist/{webpack-CJAOcYEO.js → webpack-CfkUkMXG.js} +254 -43
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +10 -5
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const require_watch_dependencies = require("./watch-dependencies-bpG6kmAf.js");
|
|
2
2
|
let node_buffer = require("node:buffer");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_watch_dependencies.__toESM(node_path);
|
|
3
6
|
let node_process = require("node:process");
|
|
4
7
|
node_process = require_watch_dependencies.__toESM(node_process);
|
|
5
8
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
@@ -30,10 +33,32 @@ function removeUnsupportedThemeKeyframes(root) {
|
|
|
30
33
|
});
|
|
31
34
|
});
|
|
32
35
|
}
|
|
36
|
+
function resolveOriginalCssSource(file, source) {
|
|
37
|
+
if (!isPlainCssResource(file)) return node_buffer.Buffer.isBuffer(source) ? source.toString("utf8") : source;
|
|
38
|
+
try {
|
|
39
|
+
return (0, node_fs.readFileSync)(file, "utf8");
|
|
40
|
+
} catch {
|
|
41
|
+
return node_buffer.Buffer.isBuffer(source) ? source.toString("utf8") : source;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function isPlainCssResource(file) {
|
|
45
|
+
return new Set([
|
|
46
|
+
".acss",
|
|
47
|
+
".css",
|
|
48
|
+
".jxss",
|
|
49
|
+
".qss",
|
|
50
|
+
".ttss",
|
|
51
|
+
".wxss"
|
|
52
|
+
]).has(node_path.default.extname(file.replace(/[?#].*$/, "")).toLowerCase());
|
|
53
|
+
}
|
|
33
54
|
const WeappTwRuntimeClassSetLoader = function(source) {
|
|
34
55
|
if (node_process.default.env["WEAPP_TW_LOADER_DEBUG"]) node_process.default.stdout.write(`[weapp-tw-runtime-classset-loader] executing for ${this.resourcePath}\n`);
|
|
35
56
|
const rawOptions = this.getOptions();
|
|
36
57
|
const opt = require_watch_dependencies.getWebpackLoaderRuntime(rawOptions?.weappTailwindcssRuntimeKey)?.classSet ?? rawOptions;
|
|
58
|
+
if (this.resourcePath) opt?.registerCssSourceFile?.({
|
|
59
|
+
file: this.resourcePath,
|
|
60
|
+
css: resolveOriginalCssSource(this.resourcePath, source)
|
|
61
|
+
});
|
|
37
62
|
const maybePromise = opt?.getClassSet?.();
|
|
38
63
|
const applyWatchDependencies = (dependencies) => {
|
|
39
64
|
for (const file of dependencies?.files ?? []) require_watch_dependencies.registerWebpackWatchFile(this, file);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-
|
|
3
|
-
import { b as refreshTailwindRuntimeState, d as _defineProperty, i as pluginName, n as getCompilerContext, t as shouldSkipJsTransform, v as createTailwindRuntimeReadyPromise, y as ensureRuntimeClassSet } from "./precheck-
|
|
4
|
-
import { r as getGroupedEntries } from "./utils-
|
|
5
|
-
import { c as hasConfiguredTailwindV4CssRoots, l as upsertTailwindV4CssSource } from "./tailwindcss-
|
|
6
|
-
import { _ as
|
|
7
|
-
import {
|
|
1
|
+
import { P as removeTailwindSourceDirectives, Y as getTailwindV4IncrementalGenerateCacheStats, a as getTailwindV3IncrementalGenerateCacheStats, h as resolveViteSourceScanEntries, ot as createDebug, u as getRuntimeClassSetSignature, ut as resolveTailwindcssOptions } from "./v3-engine-C6eJ0YzK.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-ITLd7PTl.mjs";
|
|
3
|
+
import { b as refreshTailwindRuntimeState, d as _defineProperty, i as pluginName, n as getCompilerContext, r as resolveStyleOptionsFromContext, t as shouldSkipJsTransform, v as createTailwindRuntimeReadyPromise, y as ensureRuntimeClassSet } from "./precheck-CRI90iL1.mjs";
|
|
4
|
+
import { r as getGroupedEntries } from "./utils-DodxWHGz.mjs";
|
|
5
|
+
import { c as hasConfiguredTailwindV4CssRoots, l as upsertTailwindV4CssSource } from "./tailwindcss-DTq3uYBK.mjs";
|
|
6
|
+
import { _ as createCssSourceTraceCacheSignature, a as createTailwindV3DefaultExtractor, b as processCachedTask, g as annotateCssSourceTrace, h as pruneMiniProgramGeneratedCss, l as pushConcurrentTaskFactories, m as finalizeMiniProgramCss, n as emitHmrTiming, o as createBundleRuntimeClassSetManager, p as isPureLocalCssImportWrapper, r as createSourceCandidateCollector, s as generateCssByGenerator, v as createCssTokenSourceMap, y as isCssSourceTraceEnabled } from "./hmr-timing-DQIP_8qP.mjs";
|
|
7
|
+
import { S as toAbsoluteOutputPath, c as hasBundlerGeneratedCssMarker, d as resolvePackageDir, f as resolvePluginDisabledState, n as createBundleBuildState, r as updateBundleBuildState, t as buildBundleSnapshot, u as stripBundlerGeneratedCssMarkers, v as isSourceStyleRequest, x as resolveOutputSpecifier, y as stripRequestQuery } from "./bundle-state-zQ2MrDdi.mjs";
|
|
8
8
|
import Module, { createRequire } from "node:module";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
@@ -293,8 +293,101 @@ function createWebpackAssetUpdater(options) {
|
|
|
293
293
|
}
|
|
294
294
|
//#endregion
|
|
295
295
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets.ts
|
|
296
|
+
const WEBPACK_CSS_HANDLER_OPTIONS_CACHE_MAX = 128;
|
|
297
|
+
function toMb(bytes) {
|
|
298
|
+
return Math.round(bytes / 1024 / 1024);
|
|
299
|
+
}
|
|
300
|
+
function pruneMapToMaxSize(map, maxSize) {
|
|
301
|
+
while (map.size > maxSize) {
|
|
302
|
+
const oldestKey = map.keys().next().value;
|
|
303
|
+
if (oldestKey === void 0) break;
|
|
304
|
+
map.delete(oldestKey);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function pruneWebpackCssHandlerOptionCaches(cssHandlerOptionsCache, cssUserHandlerOptionsCache, activeCssFiles) {
|
|
308
|
+
const activeSuffixes = [...activeCssFiles].map((file) => `:${file}`);
|
|
309
|
+
for (const key of cssHandlerOptionsCache.keys()) if (!activeSuffixes.some((suffix) => key.endsWith(suffix))) cssHandlerOptionsCache.delete(key);
|
|
310
|
+
for (const key of cssUserHandlerOptionsCache.keys()) if (!activeSuffixes.some((suffix) => key.endsWith(suffix))) cssUserHandlerOptionsCache.delete(key);
|
|
311
|
+
pruneMapToMaxSize(cssHandlerOptionsCache, WEBPACK_CSS_HANDLER_OPTIONS_CACHE_MAX);
|
|
312
|
+
pruneMapToMaxSize(cssUserHandlerOptionsCache, WEBPACK_CSS_HANDLER_OPTIONS_CACHE_MAX);
|
|
313
|
+
}
|
|
314
|
+
function resolveWebpackGeneratorRawSource(rawSource, cssHandlerOptions) {
|
|
315
|
+
return cssHandlerOptions.sourceOptions?.sourceCss ?? rawSource;
|
|
316
|
+
}
|
|
317
|
+
function stripStyleExtension(file) {
|
|
318
|
+
const normalized = file.replace(/[?#].*$/, "");
|
|
319
|
+
const ext = path.extname(normalized);
|
|
320
|
+
return ext ? normalized.slice(0, -ext.length) : normalized;
|
|
321
|
+
}
|
|
322
|
+
function normalizeMatchPath(file) {
|
|
323
|
+
return file.split(path.sep).join("/");
|
|
324
|
+
}
|
|
325
|
+
function isPathWithinRoot(file, root) {
|
|
326
|
+
const relative = path.relative(root, file);
|
|
327
|
+
return Boolean(relative) && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
328
|
+
}
|
|
329
|
+
function collectWebpackCssMatchBases(file, roots) {
|
|
330
|
+
const normalizedFile = file.replace(/[?#].*$/, "");
|
|
331
|
+
const bases = /* @__PURE__ */ new Set();
|
|
332
|
+
const addBase = (candidate) => {
|
|
333
|
+
const stripped = normalizeMatchPath(stripStyleExtension(candidate));
|
|
334
|
+
if (stripped.length > 0) {
|
|
335
|
+
bases.add(stripped);
|
|
336
|
+
const withoutWorkspaceSegment = stripped.replace(/^(?:src|dist)\//, "");
|
|
337
|
+
if (withoutWorkspaceSegment !== stripped && withoutWorkspaceSegment.length > 0) bases.add(withoutWorkspaceSegment);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
addBase(normalizedFile);
|
|
341
|
+
const resolvedRoots = roots.filter((root) => typeof root === "string" && root.length > 0).map((root) => path.resolve(root));
|
|
342
|
+
if (path.isAbsolute(normalizedFile)) {
|
|
343
|
+
for (const root of resolvedRoots) if (isPathWithinRoot(normalizedFile, root)) addBase(path.relative(root, normalizedFile));
|
|
344
|
+
} else for (const root of resolvedRoots) addBase(path.resolve(root, normalizedFile));
|
|
345
|
+
return bases;
|
|
346
|
+
}
|
|
347
|
+
function scoreWebpackCssSourceFileMatch(outputFile, sourceFile, options) {
|
|
348
|
+
const outputBases = collectWebpackCssMatchBases(outputFile, [options.outputRoot, options.projectRoot]);
|
|
349
|
+
const sourceBases = collectWebpackCssMatchBases(sourceFile, [options.projectRoot]);
|
|
350
|
+
let bestScore = 0;
|
|
351
|
+
for (const outputBase of outputBases) for (const sourceBase of sourceBases) if (outputBase === sourceBase) bestScore = Math.max(bestScore, 1e5 + outputBase.length);
|
|
352
|
+
else if (outputBase.endsWith(`/${sourceBase}`)) bestScore = Math.max(bestScore, 5e4 + sourceBase.length);
|
|
353
|
+
else if (sourceBase.endsWith(`/${outputBase}`)) bestScore = Math.max(bestScore, 1e3 + outputBase.length);
|
|
354
|
+
return bestScore;
|
|
355
|
+
}
|
|
356
|
+
function resolveWebpackMemoryDebugStats(context) {
|
|
357
|
+
if (process.env["WEAPP_TW_HMR_MEMORY_DEBUG"] !== "1") return;
|
|
358
|
+
const memory = process.memoryUsage();
|
|
359
|
+
return {
|
|
360
|
+
phase: context.phase,
|
|
361
|
+
process: {
|
|
362
|
+
rssMb: toMb(memory.rss),
|
|
363
|
+
heapTotalMb: toMb(memory.heapTotal),
|
|
364
|
+
heapUsedMb: toMb(memory.heapUsed),
|
|
365
|
+
externalMb: toMb(memory.external),
|
|
366
|
+
arrayBuffersMb: toMb(memory.arrayBuffers)
|
|
367
|
+
},
|
|
368
|
+
assets: {
|
|
369
|
+
active: context.activeAssetFiles,
|
|
370
|
+
activeCss: context.activeCssFiles
|
|
371
|
+
},
|
|
372
|
+
processCache: {
|
|
373
|
+
instance: context.cache.instance.size,
|
|
374
|
+
hashMap: context.cache.hashMap.size,
|
|
375
|
+
activeCacheKeys: context.activeProcessCacheKeys.size,
|
|
376
|
+
activeHashKeys: context.activeProcessHashKeys.size
|
|
377
|
+
},
|
|
378
|
+
webpackCss: {
|
|
379
|
+
handlerOptions: context.cssHandlerOptionsCache.size,
|
|
380
|
+
userHandlerOptions: context.cssUserHandlerOptionsCache.size,
|
|
381
|
+
maxHandlerOptions: WEBPACK_CSS_HANDLER_OPTIONS_CACHE_MAX
|
|
382
|
+
},
|
|
383
|
+
tailwind: {
|
|
384
|
+
v3: getTailwindV3IncrementalGenerateCacheStats(),
|
|
385
|
+
v4: getTailwindV4IncrementalGenerateCacheStats()
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
296
389
|
function setupWebpackV5ProcessAssetsHook(options) {
|
|
297
|
-
const { compiler, options: compilerOptions, appType, runtimeState, getRuntimeRefreshRequirement, refreshRuntimeMetadata, isWebpackProcessedCssAsset, consumeRuntimeRefreshRequirement, isWatchMode, runtimeClassSetManager, debug } = options;
|
|
390
|
+
const { compiler, options: compilerOptions, appType, runtimeState, getRuntimeRefreshRequirement, refreshRuntimeMetadata, isWebpackProcessedCssAsset, consumeRuntimeRefreshRequirement, isWatchMode, runtimeClassSetManager, getWebpackCssSources, debug } = options;
|
|
298
391
|
const { Compilation, sources } = compiler.webpack;
|
|
299
392
|
const { ConcatSource } = sources;
|
|
300
393
|
const isWebGeneratorTarget = compilerOptions.generator?.target === "web";
|
|
@@ -357,22 +450,65 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
357
450
|
}
|
|
358
451
|
};
|
|
359
452
|
const groupedEntries = getGroupedEntries(entries, compilerOptions);
|
|
453
|
+
const activeProcessCacheKeys = /* @__PURE__ */ new Set();
|
|
454
|
+
const activeProcessHashKeys = /* @__PURE__ */ new Set();
|
|
455
|
+
const rememberProcessCacheKey = (cacheKey, hashKey = cacheKey) => {
|
|
456
|
+
activeProcessCacheKeys.add(cacheKey);
|
|
457
|
+
activeProcessHashKeys.add(hashKey);
|
|
458
|
+
};
|
|
459
|
+
for (const chunk of compilation.chunks) if (chunk.id) activeProcessHashKeys.add(chunk.id);
|
|
460
|
+
const cssSources = new Map([...getWebpackCssSources?.() ?? []].map(([file, css]) => [path.resolve(file), css]));
|
|
461
|
+
const cssSourceFiles = [...cssSources.keys()].sort();
|
|
462
|
+
const resolveWebpackCssSourceFile = (file) => {
|
|
463
|
+
if (cssSourceFiles.length === 0) return;
|
|
464
|
+
const matches = cssSourceFiles.map((sourceFile) => ({
|
|
465
|
+
sourceFile,
|
|
466
|
+
score: scoreWebpackCssSourceFileMatch(file, sourceFile, {
|
|
467
|
+
outputRoot: outputDir,
|
|
468
|
+
projectRoot: compilerOptions.tailwindcssBasedir
|
|
469
|
+
})
|
|
470
|
+
})).filter((match) => match.score > 0).sort((a, b) => b.score - a.score);
|
|
471
|
+
const bestScore = matches[0]?.score ?? 0;
|
|
472
|
+
const bestMatches = matches.filter((match) => match.score === bestScore);
|
|
473
|
+
return bestMatches.length === 1 ? bestMatches[0]?.sourceFile : void 0;
|
|
474
|
+
};
|
|
360
475
|
const getCssHandlerOptions = (file) => {
|
|
361
476
|
const majorVersion = runtimeState.twPatcher.majorVersion;
|
|
362
477
|
const isMainChunk = compilerOptions.mainCssChunkMatcher(file, appType);
|
|
363
|
-
const
|
|
478
|
+
const sourceFile = resolveWebpackCssSourceFile(file);
|
|
479
|
+
const sourceCss = sourceFile ? cssSources.get(sourceFile) : void 0;
|
|
480
|
+
const cacheKey = [
|
|
481
|
+
majorVersion ?? "unknown",
|
|
482
|
+
isMainChunk ? "1" : "0",
|
|
483
|
+
sourceFile ?? "asset",
|
|
484
|
+
sourceCss === void 0 ? "source:0" : compilerOptions.cache.computeHash(sourceCss),
|
|
485
|
+
file
|
|
486
|
+
].join(":");
|
|
364
487
|
const cached = cssHandlerOptionsCache.get(cacheKey);
|
|
365
488
|
if (cached) return cached;
|
|
366
489
|
const created = {
|
|
367
490
|
isMainChunk,
|
|
368
|
-
postcssOptions: { options: { from: file } },
|
|
491
|
+
postcssOptions: { options: { from: sourceFile ?? file } },
|
|
492
|
+
sourceOptions: {
|
|
493
|
+
outputRoot: outputDir,
|
|
494
|
+
...sourceCss === void 0 ? {} : { sourceCss },
|
|
495
|
+
...sourceFile === void 0 ? {} : { sourceFile }
|
|
496
|
+
},
|
|
369
497
|
...majorVersion === void 0 ? {} : { majorVersion }
|
|
370
498
|
};
|
|
371
499
|
cssHandlerOptionsCache.set(cacheKey, created);
|
|
372
500
|
return created;
|
|
373
501
|
};
|
|
374
502
|
const getCssUserHandlerOptions = (file) => {
|
|
375
|
-
const
|
|
503
|
+
const majorVersion = runtimeState.twPatcher.majorVersion;
|
|
504
|
+
const sourceFile = resolveWebpackCssSourceFile(file);
|
|
505
|
+
const sourceCss = sourceFile ? cssSources.get(sourceFile) : void 0;
|
|
506
|
+
const cacheKey = [
|
|
507
|
+
majorVersion ?? "unknown",
|
|
508
|
+
sourceFile ?? "asset",
|
|
509
|
+
sourceCss === void 0 ? "source:0" : compilerOptions.cache.computeHash(sourceCss),
|
|
510
|
+
file
|
|
511
|
+
].join(":");
|
|
376
512
|
const cached = cssUserHandlerOptionsCache.get(cacheKey);
|
|
377
513
|
if (cached) return cached;
|
|
378
514
|
const created = {
|
|
@@ -382,7 +518,52 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
382
518
|
cssUserHandlerOptionsCache.set(cacheKey, created);
|
|
383
519
|
return created;
|
|
384
520
|
};
|
|
521
|
+
const refreshWebpackSourceCandidates = async () => {
|
|
522
|
+
const majorVersion = runtimeState.twPatcher.majorVersion;
|
|
523
|
+
if (majorVersion !== 3 && majorVersion !== 4) return;
|
|
524
|
+
const root = compilerOptions.tailwindcssBasedir ?? process.cwd();
|
|
525
|
+
let sourceScan;
|
|
526
|
+
try {
|
|
527
|
+
sourceScan = await resolveViteSourceScanEntries(compilerOptions, runtimeState.twPatcher, {
|
|
528
|
+
root,
|
|
529
|
+
outDir: outputDir
|
|
530
|
+
});
|
|
531
|
+
} catch (error) {
|
|
532
|
+
debug("webpack source candidate scan skipped: %O", error);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
const collector = createSourceCandidateCollector({
|
|
536
|
+
bareArbitraryValues: compilerOptions.arbitraryValues?.bareArbitraryValues,
|
|
537
|
+
extractor: majorVersion === 3 ? createTailwindV3DefaultExtractor() : void 0
|
|
538
|
+
});
|
|
539
|
+
await collector.scanRoot({
|
|
540
|
+
entries: sourceScan?.entries,
|
|
541
|
+
explicit: sourceScan?.explicit,
|
|
542
|
+
root,
|
|
543
|
+
outDir: outputDir
|
|
544
|
+
});
|
|
545
|
+
collector.syncInline(sourceScan?.inlineCandidates);
|
|
546
|
+
const candidates = sourceScan?.entries ? collector.valuesForEntries(sourceScan.entries) : collector.values();
|
|
547
|
+
return {
|
|
548
|
+
candidates,
|
|
549
|
+
getSourceCandidatesForEntries: (entries, options) => collector.valuesForEntries(entries, options),
|
|
550
|
+
signature: compilerOptions.cache.computeHash(JSON.stringify({
|
|
551
|
+
root,
|
|
552
|
+
outDir: outputDir,
|
|
553
|
+
entries: sourceScan?.entries,
|
|
554
|
+
explicit: sourceScan?.explicit ?? false,
|
|
555
|
+
inlineCandidates: sourceScan?.inlineCandidates ? {
|
|
556
|
+
included: [...sourceScan.inlineCandidates.included].sort(),
|
|
557
|
+
excluded: [...sourceScan.inlineCandidates.excluded].sort()
|
|
558
|
+
} : void 0,
|
|
559
|
+
dependencies: [...sourceScan?.dependencies ?? []].sort(),
|
|
560
|
+
candidates: [...candidates].sort()
|
|
561
|
+
})),
|
|
562
|
+
tokenSources: collector.sourcesForEntries(sourceScan?.entries)
|
|
563
|
+
};
|
|
564
|
+
};
|
|
385
565
|
const finalizeCssAssetSource = (source, options = {}) => {
|
|
566
|
+
const styleOptions = resolveStyleOptionsFromContext(compilerOptions);
|
|
386
567
|
let finalized = removeTailwindSourceDirectives(stripBundlerGeneratedCssMarkers(source), { importFallback: true });
|
|
387
568
|
if (isWebGeneratorTarget || options.generatedCss !== true) return finalized;
|
|
388
569
|
try {
|
|
@@ -391,34 +572,24 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
391
572
|
finalized = finalizeMiniProgramCss(finalized, {
|
|
392
573
|
cssPreflight: runtimeState.twPatcher.majorVersion === 4 ? compilerOptions.cssPreflight : void 0,
|
|
393
574
|
isTailwindcssV4: runtimeState.twPatcher.majorVersion === 4,
|
|
394
|
-
preservePseudoContentInit: runtimeState.twPatcher.majorVersion === 3
|
|
575
|
+
preservePseudoContentInit: runtimeState.twPatcher.majorVersion === 3,
|
|
576
|
+
tailwindcssV4GradientFallback: styleOptions.tailwindcssV4GradientFallback
|
|
395
577
|
});
|
|
396
578
|
}
|
|
397
579
|
return finalized;
|
|
398
580
|
};
|
|
399
581
|
const finalizeMiniProgramUserCssAssetSource = (source) => {
|
|
582
|
+
const styleOptions = resolveStyleOptionsFromContext(compilerOptions);
|
|
400
583
|
if (isWebGeneratorTarget) return source;
|
|
401
584
|
return finalizeMiniProgramCss(source, {
|
|
402
585
|
cssPreflight: runtimeState.twPatcher.majorVersion === 4 ? compilerOptions.cssPreflight : void 0,
|
|
403
586
|
isTailwindcssV4: runtimeState.twPatcher.majorVersion === 4,
|
|
404
|
-
preservePseudoContentInit: runtimeState.twPatcher.majorVersion === 3
|
|
587
|
+
preservePseudoContentInit: runtimeState.twPatcher.majorVersion === 3,
|
|
588
|
+
tailwindcssV4GradientFallback: styleOptions.tailwindcssV4GradientFallback
|
|
405
589
|
});
|
|
406
590
|
};
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
const sourceScan = await resolveViteSourceScanEntries(compilerOptions, runtimeState.twPatcher, { root });
|
|
410
|
-
const collector = createSourceCandidateCollector({
|
|
411
|
-
bareArbitraryValues: compilerOptions.arbitraryValues?.bareArbitraryValues,
|
|
412
|
-
extractor: runtimeState.twPatcher.majorVersion === 3 ? createTailwindV3DefaultExtractor() : void 0
|
|
413
|
-
});
|
|
414
|
-
await collector.scanRoot({
|
|
415
|
-
entries: sourceScan?.entries,
|
|
416
|
-
explicit: sourceScan?.explicit,
|
|
417
|
-
root
|
|
418
|
-
});
|
|
419
|
-
collector.syncInline(sourceScan?.inlineCandidates);
|
|
420
|
-
return createCssTokenSourceMap(collector.sourcesForEntries(sourceScan?.entries), compilerOptions);
|
|
421
|
-
})() : void 0;
|
|
591
|
+
const webpackSourceCandidates = groupedEntries.css?.length || isCssSourceTraceEnabled(compilerOptions) ? await refreshWebpackSourceCandidates() : void 0;
|
|
592
|
+
const cssSourceTraceTokenSources = isCssSourceTraceEnabled(compilerOptions) && webpackSourceCandidates ? createCssTokenSourceMap(webpackSourceCandidates.tokenSources, compilerOptions) : void 0;
|
|
422
593
|
const cssSourceTraceSignature = createCssSourceTraceCacheSignature(cssSourceTraceTokenSources, compilerOptions);
|
|
423
594
|
const annotateCss = (css) => annotateCssSourceTrace(css, {
|
|
424
595
|
opts: compilerOptions,
|
|
@@ -474,11 +645,13 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
474
645
|
const [file, originalSource] = element;
|
|
475
646
|
const rawSource = originalSource.source().toString();
|
|
476
647
|
const cacheKey = file;
|
|
648
|
+
const hashKey = `${file}:asset`;
|
|
649
|
+
rememberProcessCacheKey(cacheKey, hashKey);
|
|
477
650
|
const chunkHash = assetHashByChunk.get(file);
|
|
478
651
|
tasks.push(processCachedTask({
|
|
479
652
|
cache: compilerOptions.cache,
|
|
480
653
|
cacheKey,
|
|
481
|
-
hashKey
|
|
654
|
+
hashKey,
|
|
482
655
|
rawSource,
|
|
483
656
|
hash: chunkHash,
|
|
484
657
|
applyResult(source, { cacheHit }) {
|
|
@@ -499,6 +672,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
499
672
|
const cacheKey = getCacheKey(file);
|
|
500
673
|
const asset = compilation.getAsset(file);
|
|
501
674
|
if (!asset) continue;
|
|
675
|
+
const hashKey = `${file}:asset`;
|
|
676
|
+
rememberProcessCacheKey(cacheKey, hashKey);
|
|
502
677
|
const absoluteFile = toAbsoluteOutputPath(file, outputDir);
|
|
503
678
|
const initialSource = asset.source.source();
|
|
504
679
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
@@ -507,7 +682,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
507
682
|
await processCachedTask({
|
|
508
683
|
cache: compilerOptions.cache,
|
|
509
684
|
cacheKey,
|
|
510
|
-
hashKey
|
|
685
|
+
hashKey,
|
|
511
686
|
rawSource: initialRawSource,
|
|
512
687
|
hash: chunkHash,
|
|
513
688
|
applyResult(source, { cacheHit }) {
|
|
@@ -543,10 +718,12 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
543
718
|
const rawSource = originalSource.source().toString();
|
|
544
719
|
if (isWebpackProcessedCssAsset?.(file, rawSource)) {
|
|
545
720
|
const nextCss = finalizeCssAssetSource(rawSource, { generatedCss: hasBundlerGeneratedCssMarker(rawSource) });
|
|
721
|
+
const hashKey = `${file}:asset`;
|
|
722
|
+
rememberProcessCacheKey(file, hashKey);
|
|
546
723
|
tasks.push(processCachedTask({
|
|
547
724
|
cache: compilerOptions.cache,
|
|
548
725
|
cacheKey: file,
|
|
549
|
-
hashKey
|
|
726
|
+
hashKey,
|
|
550
727
|
rawSource,
|
|
551
728
|
hash: createRuntimeAwareCssHash(assetHashByChunk.get(file), compilerOptions.cache.computeHash(rawSource), `${runtimeSetHash}:${cssSourceTraceSignature}`),
|
|
552
729
|
applyResult(source, { cacheHit }) {
|
|
@@ -562,12 +739,21 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
562
739
|
}));
|
|
563
740
|
continue;
|
|
564
741
|
}
|
|
742
|
+
if (isWebGeneratorTarget) continue;
|
|
565
743
|
const cacheKey = file;
|
|
566
|
-
const
|
|
744
|
+
const hashKey = `${file}:asset`;
|
|
745
|
+
rememberProcessCacheKey(cacheKey, hashKey);
|
|
746
|
+
const chunkHash = assetHashByChunk.get(file);
|
|
747
|
+
const cssSourceHash = (() => {
|
|
748
|
+
const sourceFile = resolveWebpackCssSourceFile(file);
|
|
749
|
+
const sourceCss = sourceFile ? cssSources.get(sourceFile) : void 0;
|
|
750
|
+
return sourceCss === void 0 ? "webpack-css-source:0" : `webpack-css-source:1:${compilerOptions.cache.computeHash(sourceCss)}`;
|
|
751
|
+
})();
|
|
752
|
+
const runtimeAwareHash = createRuntimeAwareCssHash(chunkHash, compilerOptions.cache.computeHash(rawSource), `${runtimeSetHash}:${webpackSourceCandidates?.signature ?? "source-candidates:0"}:${cssSourceTraceSignature}:${cssSourceHash}`);
|
|
567
753
|
tasks.push(processCachedTask({
|
|
568
754
|
cache: compilerOptions.cache,
|
|
569
755
|
cacheKey,
|
|
570
|
-
hashKey
|
|
756
|
+
hashKey,
|
|
571
757
|
rawSource,
|
|
572
758
|
hash: runtimeAwareHash,
|
|
573
759
|
applyResult(source, { cacheHit }) {
|
|
@@ -579,19 +765,21 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
579
765
|
transform: async () => {
|
|
580
766
|
await runtimeState.readyPromise;
|
|
581
767
|
const cssHandlerOptions = getCssHandlerOptions(file);
|
|
768
|
+
const generatorRawSource = resolveWebpackGeneratorRawSource(rawSource, cssHandlerOptions);
|
|
582
769
|
if (isPureLocalCssImportWrapper(rawSource)) return { result: new ConcatSource(removeTailwindSourceDirectives(stripBundlerGeneratedCssMarkers(rawSource), { importFallback: true })) };
|
|
583
770
|
const generated = await generateCssByGenerator({
|
|
584
771
|
opts: compilerOptions,
|
|
585
772
|
runtimeState,
|
|
586
773
|
runtime: runtimeSet,
|
|
587
|
-
rawSource,
|
|
774
|
+
rawSource: generatorRawSource,
|
|
588
775
|
file,
|
|
589
776
|
cssHandlerOptions,
|
|
590
777
|
cssUserHandlerOptions: getCssUserHandlerOptions(file),
|
|
778
|
+
getSourceCandidatesForEntries: webpackSourceCandidates?.getSourceCandidatesForEntries,
|
|
591
779
|
styleHandler: compilerOptions.styleHandler,
|
|
592
780
|
debug
|
|
593
781
|
});
|
|
594
|
-
const source = new ConcatSource(finalizeTracedCss(
|
|
782
|
+
const source = new ConcatSource(finalizeTracedCss(generated?.css ?? finalizeCssAssetSource((await compilerOptions.styleHandler(generatorRawSource, cssHandlerOptions)).css, { generatedCss: false })));
|
|
595
783
|
if (generated) debug("css handle via tailwind v%s engine(%s): %s", runtimeState.twPatcher.majorVersion, generated.target, file);
|
|
596
784
|
else debug("css handle: %s", file);
|
|
597
785
|
return { result: source };
|
|
@@ -600,8 +788,23 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
600
788
|
}
|
|
601
789
|
pushConcurrentTaskFactories(tasks, jsTaskFactories);
|
|
602
790
|
await Promise.all(tasks);
|
|
791
|
+
compilerOptions.cache.prune?.({
|
|
792
|
+
cacheKeys: activeProcessCacheKeys,
|
|
793
|
+
hashKeys: activeProcessHashKeys
|
|
794
|
+
});
|
|
795
|
+
const activeCssFiles = new Set(groupedEntries.css?.map(([file]) => file) ?? []);
|
|
796
|
+
pruneWebpackCssHandlerOptionCaches(cssHandlerOptionsCache, cssUserHandlerOptionsCache, activeCssFiles);
|
|
603
797
|
debug("end");
|
|
604
|
-
emitHmrTiming("webpack", "processAssets", performance.now() - hmrTimingStartedAt
|
|
798
|
+
emitHmrTiming("webpack", "processAssets", performance.now() - hmrTimingStartedAt, { memoryDebug: resolveWebpackMemoryDebugStats({
|
|
799
|
+
activeAssetFiles: entries.length,
|
|
800
|
+
activeCssFiles: activeCssFiles.size,
|
|
801
|
+
activeProcessCacheKeys,
|
|
802
|
+
activeProcessHashKeys,
|
|
803
|
+
cache: compilerOptions.cache,
|
|
804
|
+
cssHandlerOptionsCache,
|
|
805
|
+
cssUserHandlerOptionsCache,
|
|
806
|
+
phase: "processAssets"
|
|
807
|
+
}) });
|
|
605
808
|
compilerOptions.onEnd();
|
|
606
809
|
});
|
|
607
810
|
});
|
|
@@ -649,10 +852,11 @@ function createLoaderAnchorFinders(appType) {
|
|
|
649
852
|
//#endregion
|
|
650
853
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.ts
|
|
651
854
|
function setupWebpackV5Loaders(options) {
|
|
652
|
-
const { compiler, options: compilerOptions, appType, weappTailwindcssPackageDir, shouldRewriteCssImports, runtimeLoaderPath, registerAutoCssSource, runtimeState, getClassSetInLoader, getRuntimeSetInLoader, markWebpackProcessedCssSource, getRuntimeWatchDependencies, runtimeRegistryKey = `weapp-tailwindcss-${Date.now()}-${Math.random().toString(36).slice(2)}`, debug } = options;
|
|
855
|
+
const { compiler, options: compilerOptions, appType, weappTailwindcssPackageDir, shouldRewriteCssImports, runtimeLoaderPath, registerAutoCssSource, runtimeState, getClassSetInLoader, getRuntimeSetInLoader, markWebpackProcessedCssSource, registerWebpackCssSourceFile, getRuntimeWatchDependencies, runtimeRegistryKey = `weapp-tailwindcss-${Date.now()}-${Math.random().toString(36).slice(2)}`, debug } = options;
|
|
653
856
|
const isMpxApp = isMpx(appType);
|
|
654
857
|
if (shouldRewriteCssImports && isMpxApp) ensureMpxTailwindcssAliases(compiler, weappTailwindcssPackageDir);
|
|
655
858
|
const runtimeClassSetLoader = runtimeLoaderPath ?? path.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js");
|
|
859
|
+
const shouldInjectRuntimeClassSetLoader = compilerOptions.generator?.target !== "web";
|
|
656
860
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? path.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js") : void 0;
|
|
657
861
|
const runtimeClassSetLoaderExists = fs.existsSync(runtimeClassSetLoader);
|
|
658
862
|
const runtimeCssImportRewriteLoaderExists = runtimeCssImportRewriteLoader ? fs.existsSync(runtimeCssImportRewriteLoader) : false;
|
|
@@ -668,7 +872,8 @@ function setupWebpackV5Loaders(options) {
|
|
|
668
872
|
setWebpackLoaderRuntime(runtimeRegistryKey, {
|
|
669
873
|
classSet: {
|
|
670
874
|
getClassSet: getClassSetInLoader,
|
|
671
|
-
getWatchDependencies: getRuntimeWatchDependencies
|
|
875
|
+
getWatchDependencies: getRuntimeWatchDependencies,
|
|
876
|
+
...registerWebpackCssSourceFile === void 0 ? {} : { registerCssSourceFile: registerWebpackCssSourceFile }
|
|
672
877
|
},
|
|
673
878
|
...runtimeLoaderRewriteOptions === void 0 ? {} : { cssImportRewrite: runtimeLoaderRewriteOptions }
|
|
674
879
|
});
|
|
@@ -726,7 +931,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
726
931
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
727
932
|
}
|
|
728
933
|
}
|
|
729
|
-
if (runtimeClassSetLoaderExists && !hasLoaderEntry(loaderEntries, runtimeClassSetLoader)) {
|
|
934
|
+
if (shouldInjectRuntimeClassSetLoader && runtimeClassSetLoaderExists && !hasLoaderEntry(loaderEntries, runtimeClassSetLoader)) {
|
|
730
935
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
731
936
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
732
937
|
if (anchorIndex === -1) anchorlessInsert(classSetLoaderEntry, "before");
|
|
@@ -834,6 +1039,7 @@ var WeappTailwindcss = class {
|
|
|
834
1039
|
const runtimeWatchDependencyFiles = /* @__PURE__ */ new Set();
|
|
835
1040
|
const runtimeWatchDependencyContexts = /* @__PURE__ */ new Set();
|
|
836
1041
|
const webpackProcessedCssSourceFiles = /* @__PURE__ */ new Set();
|
|
1042
|
+
const webpackCssSources = /* @__PURE__ */ new Map();
|
|
837
1043
|
let runtimeMetadataPrepared = false;
|
|
838
1044
|
const updateRuntimeWatchDependencies = async () => {
|
|
839
1045
|
runtimeWatchDependencyFiles.clear();
|
|
@@ -881,7 +1087,7 @@ var WeappTailwindcss = class {
|
|
|
881
1087
|
syncRuntimeRefreshRequirement();
|
|
882
1088
|
};
|
|
883
1089
|
const registerAutoCssSource = async (source) => {
|
|
884
|
-
if (
|
|
1090
|
+
if ((runtimeState.twPatcher.majorVersion ?? 0) < 4 || !source.file) return;
|
|
885
1091
|
if (!upsertTailwindV4CssSource(this.options, source)) return;
|
|
886
1092
|
runtimeSetPrepared = false;
|
|
887
1093
|
runtimeMetadataPrepared = false;
|
|
@@ -895,6 +1101,9 @@ var WeappTailwindcss = class {
|
|
|
895
1101
|
const markWebpackProcessedCssSource = (file) => {
|
|
896
1102
|
webpackProcessedCssSourceFiles.add(path.resolve(file));
|
|
897
1103
|
};
|
|
1104
|
+
const registerWebpackCssSourceFile = (source) => {
|
|
1105
|
+
webpackCssSources.set(path.resolve(source.file), source.css);
|
|
1106
|
+
};
|
|
898
1107
|
const isWebpackProcessedTailwindEntryAsset = (file) => {
|
|
899
1108
|
if ((runtimeState.twPatcher.majorVersion ?? 0) < 4 || !this.options.mainCssChunkMatcher(file, this.appType) || webpackProcessedCssSourceFiles.size === 0) return false;
|
|
900
1109
|
const tailwindOptions = resolveTailwindcssOptions(runtimeState.twPatcher.options);
|
|
@@ -942,6 +1151,7 @@ var WeappTailwindcss = class {
|
|
|
942
1151
|
getClassSetInLoader,
|
|
943
1152
|
getRuntimeSetInLoader,
|
|
944
1153
|
markWebpackProcessedCssSource,
|
|
1154
|
+
registerWebpackCssSourceFile,
|
|
945
1155
|
getRuntimeWatchDependencies() {
|
|
946
1156
|
return {
|
|
947
1157
|
files: runtimeWatchDependencyFiles,
|
|
@@ -965,6 +1175,7 @@ var WeappTailwindcss = class {
|
|
|
965
1175
|
},
|
|
966
1176
|
isWatchMode: () => watchRunObserved || compiler.options?.watch === true,
|
|
967
1177
|
runtimeClassSetManager: this.options.__internalWebpackRuntimeClassSetManager,
|
|
1178
|
+
getWebpackCssSources: () => webpackCssSources,
|
|
968
1179
|
debug
|
|
969
1180
|
});
|
|
970
1181
|
}
|