weapp-tailwindcss 5.0.13 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/auto-Ba6hDrse.mjs +13 -0
- package/dist/auto-DtU6f3X6.js +18 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +2 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +10 -6
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +0 -1
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/types.d.ts +13 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -1
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/shared/run-tasks.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +16 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +0 -1
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +39 -0
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +13 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/html-processing.d.ts +26 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +21 -18
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/runtime-linked-source-memory.d.ts +25 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/tailwind-v4-css-source.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/transform-filter.d.ts +15 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle.d.ts +2 -1
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +3 -3
- package/dist/bundlers/vite/plugin-cache.d.ts +15 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +5 -4
- package/dist/bundlers/vite/source-candidates/script.d.ts +1 -7
- package/dist/bundlers/vite/source-candidates.d.ts +9 -2
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +2 -6
- package/dist/bundlers/vite/source-scan.d.ts +2 -2
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/utils.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +26 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +34 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -11
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/js-module-graph.d.ts +37 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +199 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-refresh.d.ts +11 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +4 -2
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +10 -1
- package/dist/bundlers/webpack/shared/css-loader-runtime.d.ts +1 -0
- package/dist/cache/index.d.ts +1 -0
- package/dist/cli/mount-options.d.ts +2 -2
- package/dist/cli.js +138 -444
- package/dist/cli.mjs +134 -440
- package/dist/context/index.d.ts +3 -3
- package/dist/context/style-options.d.ts +5 -1
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/{precheck-B0Z8yW7E.js → context-B6hVF7dr.js} +405 -156
- package/dist/{precheck-CRI90iL1.mjs → context-DlpKD7aN.mjs} +377 -141
- package/dist/core.js +15 -12
- package/dist/core.mjs +10 -7
- package/dist/css-macro/index.d.ts +3 -7
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-Bqx18S1f.mjs → defaults-BhE26nSw.mjs} +12 -13
- package/dist/{defaults-C_J_kBpw.js → defaults-CmFBmxsr.js} +11 -18
- package/dist/defaults.d.ts +2 -8
- package/dist/defaults.js +1 -2
- package/dist/defaults.mjs +2 -2
- package/dist/generator/index.d.ts +6 -7
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +9 -10
- package/dist/generator-6oMJtTDO.js +170 -0
- package/dist/generator-CjzBK7h-.mjs +123 -0
- package/dist/generator.js +10 -16
- package/dist/generator.mjs +3 -3
- package/dist/{gulp-XT8Jc7lH.js → gulp-BtGq6LP9.js} +49 -87
- package/dist/{gulp-DfOQERcV.mjs → gulp-DNU10Vtc.mjs} +42 -80
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DQIP_8qP.mjs → hmr-timing-B0KuWDjV.mjs} +1197 -858
- package/dist/{hmr-timing-BMftW7Us.js → hmr-timing-CegXR9O4.js} +1356 -927
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/fast-path/oxc.d.ts +4 -0
- package/dist/js/precheck.d.ts +1 -0
- package/dist/postcss.js +3 -4
- package/dist/postcss.mjs +2 -3
- package/dist/presets.js +9 -19
- package/dist/presets.mjs +8 -18
- package/dist/runtime-branch/create-branch.d.ts +2 -0
- package/dist/runtime-branch/generator-target-env.d.ts +4 -0
- package/dist/runtime-branch/index.d.ts +6 -0
- package/dist/runtime-branch/mini-program.d.ts +2 -0
- package/dist/runtime-branch/native-app.d.ts +2 -0
- package/dist/runtime-branch/platform.d.ts +6 -0
- package/dist/runtime-branch/tailwind-version.d.ts +2 -0
- package/dist/runtime-branch/types.d.ts +37 -0
- package/dist/runtime-branch/web.d.ts +2 -0
- package/dist/runtime-branch.d.ts +1 -0
- package/dist/{bundle-state-zQ2MrDdi.mjs → source-candidate-scan-signature-B5af2Ahe.mjs} +187 -17
- package/dist/{bundle-state-CKWeTEhv.js → source-candidate-scan-signature-BKYb9jxa.js} +261 -19
- package/dist/tailwindcss/candidates.d.ts +7 -0
- package/dist/tailwindcss/index.d.ts +2 -2
- package/dist/tailwindcss/runtime/cache.d.ts +6 -6
- package/dist/tailwindcss/runtime-factory.d.ts +12 -0
- package/dist/tailwindcss/runtime-options.d.ts +8 -0
- package/dist/tailwindcss/runtime-types.d.ts +87 -0
- package/dist/tailwindcss/runtime.d.ts +6 -6
- package/dist/tailwindcss/source-scan.d.ts +1 -1
- package/dist/tailwindcss/targets.d.ts +2 -2
- package/dist/tailwindcss/v4/config.d.ts +3 -3
- package/dist/tailwindcss/v4/css-entries.d.ts +1 -0
- package/dist/tailwindcss/v4/css-sources.d.ts +4 -2
- package/dist/tailwindcss/v4/index.d.ts +1 -1
- package/dist/tailwindcss/v4/multi-runtime.d.ts +2 -0
- package/dist/tailwindcss/v4/runtime-factory.d.ts +15 -0
- package/dist/tailwindcss/v4/runtime-options.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +3 -3
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +10 -3
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +7 -1
- package/dist/tailwindcss/v4-engine/source.d.ts +15 -7
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -10
- package/dist/tailwindcss/version.d.ts +1 -1
- package/dist/tailwindcss-B5mRo0-M.mjs +1423 -0
- package/dist/tailwindcss-dbrbY4cd.js +1528 -0
- package/dist/{transform-DfcEjsZF.mjs → transform-fRBeuuK-.mjs} +2 -2
- package/dist/{transform-YmrmxuF3.js → transform-vLwZpiTE.js} +17 -17
- package/dist/typedoc.export.d.ts +1 -1
- package/dist/types/index.d.ts +16 -17
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/{typedoc-tailwindcss-patch.d.ts → typedoc-tailwindcss-runtime.d.ts} +4 -10
- package/dist/types/user-defined-options/general.d.ts +5 -3
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/types/user-defined-options/matcher.d.ts +7 -0
- package/dist/uni-app-x/style-asset.d.ts +1 -0
- package/dist/v4-engine-C3qSwQ-e.mjs +2376 -0
- package/dist/v4-engine-ON_oSLfO.js +2752 -0
- package/dist/{vite-DjI09vVN.mjs → vite-CWRooooa.mjs} +1417 -540
- package/dist/{vite-CXHVsHmX.js → vite-w-RkgaTY.js} +1575 -698
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +5665 -4443
- package/dist/weapp-tw-runtime-classset-loader.js +15 -4
- package/dist/webpack-8PaV1gG3.mjs +2334 -0
- package/dist/webpack-CGgBOx9l.js +2346 -0
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +6 -7
- package/dist/auto-CTp6wE5a.js +0 -33
- package/dist/auto-Cl8_hsG6.mjs +0 -22
- package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +0 -13
- package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +0 -1
- package/dist/context/tailwindcss/rax.d.ts +0 -2
- package/dist/generator-CzpArpCL.js +0 -92
- package/dist/generator-ITLd7PTl.mjs +0 -67
- package/dist/tailwindcss/patcher-options.d.ts +0 -8
- package/dist/tailwindcss/patcher.d.ts +0 -12
- package/dist/tailwindcss/runtime-patch.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +0 -3
- package/dist/tailwindcss/v3-engine/generator/content.d.ts +0 -10
- package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +0 -2
- package/dist/tailwindcss/v3-engine/generator.d.ts +0 -19
- package/dist/tailwindcss/v3-engine/index.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/source.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +0 -61
- package/dist/tailwindcss/v4/multi-patcher.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher.d.ts +0 -15
- package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +0 -1
- package/dist/tailwindcss-DTq3uYBK.mjs +0 -556
- package/dist/tailwindcss-DZEwT3C_.js +0 -613
- package/dist/v3-engine-2rrgylhn.js +0 -4686
- package/dist/v3-engine-C6eJ0YzK.mjs +0 -4272
- package/dist/webpack-BcPpnT90.mjs +0 -1184
- package/dist/webpack-CfkUkMXG.js +0 -1196
- /package/dist/tailwindcss/{patcher-resolve.d.ts → runtime-resolve.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { C as hasTailwindRootDirectives, D as normalizeTailwindSourceForGenerator, G as getTailwindV4IncrementalGenerateCacheStats, T as normalizeTailwindConfigDirectives, U as prependConfigDirective, o as hasConfiguredTailwindV4CssRoots, s as upsertTailwindV4CssSource } from "./v4-engine-C3qSwQ-e.mjs";
|
|
2
|
+
import { S as createDebug, b as ensureRuntimeClassSet, l as shouldSkipJsTransform, n as normalizeStyleHandlerMajorVersion, t as getCompilerContext, y as createTailwindRuntimeReadyPromise } from "./context-DlpKD7aN.mjs";
|
|
3
|
+
import { l as getRuntimeClassSetSignature, p as resolveViteSourceScanEntries } from "./tailwindcss-B5mRo0-M.mjs";
|
|
4
|
+
import { F as createCssTokenSourceMap, L as processCachedTask, N as annotateCssSourceTrace, P as createCssSourceTraceCacheSignature, n as emitHmrTiming, r as createSourceCandidateCollector, s as createBundleRuntimeClassSetManager, u as generateCssByGenerator, v as rewriteLocalCssImportRequestsForOutput, y as splitLocalCssImports } from "./hmr-timing-B0KuWDjV.mjs";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
@@ -182,10 +182,7 @@ function resolveGulpMemoryDebugStats(context) {
|
|
|
182
182
|
maxCacheKeys: GULP_PROCESS_CACHE_MAX
|
|
183
183
|
},
|
|
184
184
|
gulpOptions: { defaultStyleHandlerOptions: context.defaultStyleHandlerOptionsCache.size },
|
|
185
|
-
tailwind: {
|
|
186
|
-
v3: getTailwindV3IncrementalGenerateCacheStats(),
|
|
187
|
-
v4: getTailwindV4IncrementalGenerateCacheStats()
|
|
188
|
-
}
|
|
185
|
+
tailwind: { v4: getTailwindV4IncrementalGenerateCacheStats() }
|
|
189
186
|
};
|
|
190
187
|
}
|
|
191
188
|
/**
|
|
@@ -199,13 +196,15 @@ function createPlugins(options = {}) {
|
|
|
199
196
|
...options,
|
|
200
197
|
__internalDeferMissingCssEntriesWarning: true
|
|
201
198
|
});
|
|
202
|
-
const { templateHandler, styleHandler, jsHandler, cache
|
|
203
|
-
const
|
|
199
|
+
const { templateHandler, styleHandler, jsHandler, cache } = opts;
|
|
200
|
+
const initialTailwindRuntime = opts.tailwindRuntime;
|
|
201
|
+
const refreshTailwindcssRuntime = opts.refreshTailwindcssRuntime;
|
|
202
|
+
const readyPromise = createTailwindRuntimeReadyPromise(initialTailwindRuntime);
|
|
204
203
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
205
204
|
const runtimeState = {
|
|
206
|
-
|
|
205
|
+
tailwindRuntime: initialTailwindRuntime,
|
|
207
206
|
readyPromise,
|
|
208
|
-
|
|
207
|
+
refreshTailwindcssRuntime
|
|
209
208
|
};
|
|
210
209
|
const defaultStyleHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
211
210
|
let cachedDefaultTemplateHandlerOptions;
|
|
@@ -217,13 +216,10 @@ function createPlugins(options = {}) {
|
|
|
217
216
|
let runtimeSetDirty = false;
|
|
218
217
|
const runtimeSourceHashByFile = /* @__PURE__ */ new Map();
|
|
219
218
|
const runtimeSourcesByFile = /* @__PURE__ */ new Map();
|
|
220
|
-
let cachedGulpSourceCandidates;
|
|
221
219
|
let cachedGulpSourceCandidateSignature;
|
|
222
220
|
const gulpProcessCacheKeys = /* @__PURE__ */ new Set();
|
|
223
|
-
const sourceCandidateExtractor = initialTwPatcher.majorVersion === 3 ? createTailwindV3DefaultExtractor() : void 0;
|
|
224
221
|
const bundleRuntimeClassSetManager = options.__internalGulpRuntimeClassSetManager ?? createBundleRuntimeClassSetManager();
|
|
225
222
|
function invalidateGulpSourceCandidates() {
|
|
226
|
-
cachedGulpSourceCandidates = void 0;
|
|
227
223
|
cachedGulpSourceCandidateSignature = void 0;
|
|
228
224
|
cachedGulpSourceCandidateGetter = void 0;
|
|
229
225
|
cachedGulpSourceCandidateSourceGetter = void 0;
|
|
@@ -261,8 +257,8 @@ function createPlugins(options = {}) {
|
|
|
261
257
|
pruneGulpRuntimeSourceCaches(runtimeSourceHashByFile, runtimeSourcesByFile);
|
|
262
258
|
if (changed) invalidateGulpSourceCandidates();
|
|
263
259
|
if (!changed && runtimeSetInitialized) return runtimeSet;
|
|
264
|
-
if (
|
|
265
|
-
runtimeSet = await bundleRuntimeClassSetManager.sync(runtimeState.
|
|
260
|
+
if (!runtimeSetDirty) try {
|
|
261
|
+
runtimeSet = await bundleRuntimeClassSetManager.sync(runtimeState.tailwindRuntime, createGulpRuntimeSnapshot(runtimeSourcesByFile, [filename]));
|
|
266
262
|
runtimeSetInitialized = true;
|
|
267
263
|
return runtimeSet;
|
|
268
264
|
} catch (error) {
|
|
@@ -271,44 +267,9 @@ function createPlugins(options = {}) {
|
|
|
271
267
|
}
|
|
272
268
|
return refreshRuntimeSet({ forceCollect: true });
|
|
273
269
|
}
|
|
274
|
-
async function refreshGulpSourceCandidates(forceRefresh = false) {
|
|
275
|
-
if (runtimeState.twPatcher.majorVersion !== 3) return /* @__PURE__ */ new Set();
|
|
276
|
-
const root = opts.tailwindcssBasedir ?? process.cwd();
|
|
277
|
-
const sourceScan = await resolveViteSourceScanEntries(opts, runtimeState.twPatcher, { root });
|
|
278
|
-
const nextSignature = cache.computeHash(JSON.stringify({
|
|
279
|
-
root,
|
|
280
|
-
entries: sourceScan?.entries,
|
|
281
|
-
inlineCandidates: sourceScan?.inlineCandidates ? {
|
|
282
|
-
included: [...sourceScan.inlineCandidates.included].sort(),
|
|
283
|
-
excluded: [...sourceScan.inlineCandidates.excluded].sort()
|
|
284
|
-
} : void 0,
|
|
285
|
-
explicit: sourceScan?.explicit ?? false,
|
|
286
|
-
dependencies: [...sourceScan?.dependencies ?? []].sort()
|
|
287
|
-
}));
|
|
288
|
-
if (!forceRefresh && cachedGulpSourceCandidateSignature === nextSignature && cachedGulpSourceCandidates) return cachedGulpSourceCandidates;
|
|
289
|
-
const collector = createSourceCandidateCollector({
|
|
290
|
-
bareArbitraryValues: opts.arbitraryValues?.bareArbitraryValues,
|
|
291
|
-
extractor: sourceCandidateExtractor
|
|
292
|
-
});
|
|
293
|
-
await collector.scanRoot({
|
|
294
|
-
entries: sourceScan?.entries,
|
|
295
|
-
root
|
|
296
|
-
});
|
|
297
|
-
collector.syncInline(sourceScan?.inlineCandidates);
|
|
298
|
-
cachedGulpSourceCandidateSignature = nextSignature;
|
|
299
|
-
cachedGulpSourceCandidateGetter = (entries) => collector.valuesForEntries(entries);
|
|
300
|
-
cachedGulpSourceCandidateSourceGetter = (entries) => collector.sourcesForEntries(entries);
|
|
301
|
-
cachedGulpSourceCandidates = sourceScan?.entries ? collector.valuesForEntries(sourceScan.entries) : collector.values();
|
|
302
|
-
return cachedGulpSourceCandidates;
|
|
303
|
-
}
|
|
304
270
|
async function refreshGulpV4SourceCandidates(forceRefresh = false) {
|
|
305
|
-
if (runtimeState.twPatcher.majorVersion !== 4) {
|
|
306
|
-
cachedGulpSourceCandidateGetter = void 0;
|
|
307
|
-
cachedGulpSourceCandidateSourceGetter = void 0;
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
271
|
const root = opts.tailwindcssBasedir ?? process.cwd();
|
|
311
|
-
const sourceScan = await resolveViteSourceScanEntries(opts, runtimeState.
|
|
272
|
+
const sourceScan = await resolveViteSourceScanEntries(opts, runtimeState.tailwindRuntime, { root });
|
|
312
273
|
const nextSignature = cache.computeHash(JSON.stringify({
|
|
313
274
|
root,
|
|
314
275
|
entries: sourceScan?.entries,
|
|
@@ -332,23 +293,26 @@ function createPlugins(options = {}) {
|
|
|
332
293
|
cachedGulpSourceCandidateSourceGetter = (entries) => collector.sourcesForEntries(entries);
|
|
333
294
|
return cachedGulpSourceCandidateGetter;
|
|
334
295
|
}
|
|
335
|
-
function createRuntimeSetHash(rawSource, nextRuntimeSet, sourceTraceSignature, sourceCandidateSignature) {
|
|
296
|
+
function createRuntimeSetHash(rawSource, nextRuntimeSet, sourceTraceSignature, sourceCandidateSignature, outputSignature) {
|
|
336
297
|
return cache.computeHash([
|
|
337
298
|
rawSource,
|
|
338
|
-
getRuntimeClassSetSignature(runtimeState.
|
|
299
|
+
getRuntimeClassSetSignature(runtimeState.tailwindRuntime),
|
|
339
300
|
[...nextRuntimeSet].sort().join("\n"),
|
|
340
301
|
sourceTraceSignature ?? "css-source-trace:0",
|
|
341
|
-
sourceCandidateSignature ?? "gulp-source-candidates:0"
|
|
302
|
+
sourceCandidateSignature ?? "gulp-source-candidates:0",
|
|
303
|
+
outputSignature ?? "gulp-output:0"
|
|
342
304
|
].join("\n\n"));
|
|
343
305
|
}
|
|
344
306
|
async function registerAutoCssSource(file, rawSource) {
|
|
345
|
-
if (hasInitialTailwindCssRoots || (runtimeState.
|
|
307
|
+
if (hasInitialTailwindCssRoots || (runtimeState.tailwindRuntime.majorVersion ?? 0) < 4 || !file.path || !hasTailwindRootDirectives(rawSource)) return false;
|
|
346
308
|
const sourceFile = path.resolve(file.path);
|
|
347
309
|
const sourceCss = normalizeTailwindSourceForGenerator(normalizeTailwindConfigDirectives(rawSource, path.dirname(sourceFile)), { importFallback: true });
|
|
310
|
+
const config = runtimeState.tailwindRuntime.options?.tailwindcss?.config;
|
|
311
|
+
const generatorSourceCss = prependConfigDirective(splitLocalCssImports(sourceCss)?.source ?? sourceCss, config);
|
|
348
312
|
if (!upsertTailwindV4CssSource(opts, {
|
|
349
313
|
file: sourceFile,
|
|
350
314
|
base: path.dirname(sourceFile),
|
|
351
|
-
css:
|
|
315
|
+
css: generatorSourceCss
|
|
352
316
|
})) return false;
|
|
353
317
|
runtimeSetInitialized = false;
|
|
354
318
|
runtimeSetDirty = true;
|
|
@@ -362,20 +326,24 @@ function createPlugins(options = {}) {
|
|
|
362
326
|
return cachedDefaultModuleGraphOptions;
|
|
363
327
|
}
|
|
364
328
|
function resolveWxssHandlerOptions(options) {
|
|
365
|
-
const
|
|
329
|
+
const styleHandlerMajorVersion = normalizeStyleHandlerMajorVersion(runtimeState.tailwindRuntime.majorVersion);
|
|
330
|
+
const majorVersion = styleHandlerMajorVersion ?? "unknown";
|
|
366
331
|
if (!options || Object.keys(options).length === 0) {
|
|
367
332
|
let cached = defaultStyleHandlerOptionsCache.get(majorVersion);
|
|
368
333
|
if (!cached) {
|
|
369
|
-
cached =
|
|
334
|
+
cached = styleHandlerMajorVersion === void 0 ? {} : { majorVersion: styleHandlerMajorVersion };
|
|
370
335
|
defaultStyleHandlerOptionsCache.set(majorVersion, cached);
|
|
371
336
|
}
|
|
372
337
|
return cached;
|
|
373
338
|
}
|
|
374
|
-
return
|
|
375
|
-
majorVersion:
|
|
339
|
+
return styleHandlerMajorVersion === void 0 ? { ...options } : {
|
|
340
|
+
majorVersion: styleHandlerMajorVersion,
|
|
376
341
|
...options
|
|
377
342
|
};
|
|
378
343
|
}
|
|
344
|
+
function resolveGulpStyleOutputExtension(file) {
|
|
345
|
+
return typeof opts.cssMatcher === "function" && opts.cssMatcher(path.basename(file.path)) ? path.extname(file.path) : void 0;
|
|
346
|
+
}
|
|
379
347
|
function resolveGulpMatcherName(file) {
|
|
380
348
|
return (file.relative || path.basename(file.path)).replaceAll(path.sep, "/");
|
|
381
349
|
}
|
|
@@ -445,30 +413,23 @@ function createPlugins(options = {}) {
|
|
|
445
413
|
if (!file.contents) return;
|
|
446
414
|
const rawSource = file.contents.toString();
|
|
447
415
|
const cssSourceChanged = await registerAutoCssSource(file, rawSource);
|
|
448
|
-
const
|
|
449
|
-
const shouldUseGenerator = runtimeState.twPatcher.majorVersion !== 3 || hasTailwindRootDirectives(rawSource);
|
|
416
|
+
const shouldUseGenerator = runtimeState.tailwindRuntime.majorVersion === 4;
|
|
450
417
|
let gulpSourceCandidateGetter;
|
|
451
|
-
if (shouldUseGenerator
|
|
452
|
-
|
|
418
|
+
if (shouldUseGenerator) gulpSourceCandidateGetter = await refreshGulpV4SourceCandidates(cssSourceChanged);
|
|
419
|
+
const nextRuntimeSet = await refreshRuntimeSet({
|
|
453
420
|
forceRefresh: cssSourceChanged,
|
|
454
|
-
forceCollect: cssSourceChanged
|
|
421
|
+
forceCollect: cssSourceChanged,
|
|
455
422
|
clearCache: cssSourceChanged
|
|
456
423
|
});
|
|
457
|
-
if (runtimeState.twPatcher.majorVersion === 3 && shouldUseGenerator) {
|
|
458
|
-
const sourceCandidates = await refreshGulpSourceCandidates(cssSourceChanged || isMainChunk);
|
|
459
|
-
gulpSourceCandidateGetter = cachedGulpSourceCandidateGetter;
|
|
460
|
-
if (sourceCandidates.size > 0) {
|
|
461
|
-
nextRuntimeSet = new Set([...nextRuntimeSet, ...sourceCandidates]);
|
|
462
|
-
runtimeSet = nextRuntimeSet;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
424
|
const sourceTraceTokenSources = cachedGulpSourceCandidateSourceGetter ? createCssTokenSourceMap(cachedGulpSourceCandidateSourceGetter(void 0), opts) : void 0;
|
|
466
425
|
const sourceTraceSignature = createCssSourceTraceCacheSignature(sourceTraceTokenSources, opts);
|
|
467
426
|
const sourceCandidateSignature = cachedGulpSourceCandidateGetter ? `gulp-source-candidates:1:${[...cachedGulpSourceCandidateGetter(void 0)].sort().join("\n")}` : void 0;
|
|
427
|
+
const styleOutputExtension = resolveGulpStyleOutputExtension(file);
|
|
428
|
+
const outputSignature = styleOutputExtension ? `gulp-output:1:${styleOutputExtension}` : "gulp-output:0";
|
|
468
429
|
await processCachedTask({
|
|
469
430
|
cache,
|
|
470
431
|
cacheKey: file.path,
|
|
471
|
-
hash: createRuntimeSetHash(rawSource, nextRuntimeSet, sourceTraceSignature, sourceCandidateSignature),
|
|
432
|
+
hash: createRuntimeSetHash(rawSource, nextRuntimeSet, sourceTraceSignature, sourceCandidateSignature, outputSignature),
|
|
472
433
|
applyResult(source) {
|
|
473
434
|
file.contents = Buffer.from(source);
|
|
474
435
|
},
|
|
@@ -478,7 +439,7 @@ function createPlugins(options = {}) {
|
|
|
478
439
|
async transform() {
|
|
479
440
|
await runtimeState.readyPromise;
|
|
480
441
|
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, rawSource, options);
|
|
481
|
-
const
|
|
442
|
+
const outputCss = rewriteLocalCssImportRequestsForOutput(annotateCssSourceTrace((shouldUseGenerator ? await generateCssByGenerator({
|
|
482
443
|
opts,
|
|
483
444
|
runtimeState,
|
|
484
445
|
runtime: nextRuntimeSet,
|
|
@@ -492,9 +453,9 @@ function createPlugins(options = {}) {
|
|
|
492
453
|
}) : void 0)?.css ?? (await styleHandler(rawSource, cssHandlerOptions)).css, {
|
|
493
454
|
opts,
|
|
494
455
|
tokenSources: sourceTraceTokenSources
|
|
495
|
-
});
|
|
456
|
+
}), { styleOutputExtension });
|
|
496
457
|
debug("css handle: %s", file.path);
|
|
497
|
-
return { result:
|
|
458
|
+
return { result: outputCss };
|
|
498
459
|
}
|
|
499
460
|
});
|
|
500
461
|
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
@@ -509,6 +470,7 @@ function createPlugins(options = {}) {
|
|
|
509
470
|
const moduleGraph = resolveModuleGraphOptions(options.moduleGraph);
|
|
510
471
|
const handlerOptions = {
|
|
511
472
|
...options,
|
|
473
|
+
generateMap: false,
|
|
512
474
|
filename,
|
|
513
475
|
moduleGraph,
|
|
514
476
|
babelParserOptions: {
|
|
@@ -516,7 +478,7 @@ function createPlugins(options = {}) {
|
|
|
516
478
|
sourceFilename: filename
|
|
517
479
|
}
|
|
518
480
|
};
|
|
519
|
-
if (runtimeState.
|
|
481
|
+
if (runtimeState.tailwindRuntime.majorVersion !== void 0) handlerOptions.tailwindcssMajorVersion = runtimeState.tailwindRuntime.majorVersion;
|
|
520
482
|
await processCachedTask({
|
|
521
483
|
cache,
|
|
522
484
|
cacheKey: file.path,
|
package/dist/gulp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_gulp = require("./gulp-
|
|
2
|
+
const require_gulp = require("./gulp-BtGq6LP9.js");
|
|
3
3
|
exports.WeappTailwindcss = require_gulp.createPlugins;
|
|
4
4
|
exports.createPlugins = require_gulp.createPlugins;
|
|
5
5
|
exports.weappTailwindcss = require_gulp.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlugins } from "./gulp-
|
|
1
|
+
import { t as createPlugins } from "./gulp-DNU10Vtc.mjs";
|
|
2
2
|
export { createPlugins as WeappTailwindcss, createPlugins, createPlugins as weappTailwindcss };
|