weapp-tailwindcss 5.2.6 → 5.2.8
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/bundlers/shared/final-css-cleanup.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +8 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +5 -3
- package/dist/bundlers/vite/module-identity.d.ts +9 -0
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +0 -1
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +1 -0
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +4 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +1 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +2 -1
- package/dist/bundlers/vite/shared/framework-hmr-candidate-state.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +4 -0
- package/dist/cli.js +1 -0
- package/dist/{context-YAvTyPV2.js → context-BMkbwnH8.js} +10 -23
- package/dist/{context-OqD_eBxQ.cjs → context-CByXWyhQ.cjs} +179 -25
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{generator-BE34PYSC.cjs → generator-B0dCFlP1.cjs} +10 -0
- package/dist/{generator-DYeAa2-5.js → generator-BLpOsd5O.js} +10 -0
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-DCItlfoq.js → gulp-BWhCahA2.js} +7 -7
- package/dist/{gulp-CPIE1yPk.cjs → gulp-BdoorWb5.cjs} +10 -10
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-BevXxu6p.js → hmr-timing-CJocHeZr.js} +122 -16
- package/dist/{hmr-timing-Chyd_Yfw.cjs → hmr-timing-DiYnyg_W.cjs} +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{options-hVsoTfwL.cjs → options-zpZez7qe.cjs} +1 -1
- package/dist/{pipeline-helpers-Cwv-X4Rj.cjs → pipeline-helpers-CsNLoEX1.cjs} +4 -4
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -2
- package/dist/presets.js +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/{source-candidate-scan-signature-DG5mQZ8o.cjs → source-candidate-scan-signature-D9FXTD9a.cjs} +3 -3
- package/dist/{source-candidate-scan-signature-DLFqYads.js → source-candidate-scan-signature-of-TmeOs.js} +3 -3
- package/dist/{style-options-B_ppaVIg.cjs → style-options-COpQc8fr.cjs} +2 -2
- package/dist/{tailwindcss-CTpCc_nd.js → tailwindcss-2zdmASlM.js} +1 -1
- package/dist/{tailwindcss-DcpiKvmJ.cjs → tailwindcss-LtnGCxF0.cjs} +2 -2
- package/dist/{transform-BbaPIji9.js → transform-DVGsr8cV.js} +24 -7
- package/dist/{transform-BUEyOCT7.cjs → transform-DzVJW6Dp.cjs} +24 -7
- package/dist/uni-app-x/component-local-style.d.ts +1 -0
- package/dist/uni-app-x/vite/author-apply.d.ts +1 -0
- package/dist/uni-app-x/vite/harmony-apply.d.ts +4 -1
- package/dist/uni-app-x/vite/native-hmr.d.ts +2 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +27 -0
- package/dist/uni-app-x/vite/style-request.d.ts +3 -0
- package/dist/uni-app-x/vite.d.ts +3 -24
- package/dist/{v4-generation-core-Dtmu8Yax.cjs → v4-generation-core-BjHT6qGC.cjs} +132 -14
- package/dist/{vite-Bk1YU9L0.js → vite-BJJqWc_F.js} +567 -292
- package/dist/{vite-DmN_Y8Uk.cjs → vite-V86H6PZa.cjs} +570 -295
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +5 -5
- package/dist/{webpack-DtkSnYyR.js → webpack-CkeFhPY2.js} +7 -7
- package/dist/{webpack-DvmrFist.cjs → webpack-CzQrloDg.cjs} +9 -9
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +4 -4
- package/dist/bundlers/vite/processed-css-assets/empty-at-rule.d.ts +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface TailwindDirectiveOptions {
|
|
2
2
|
importFallback?: boolean | undefined;
|
|
3
|
+
preserveApplyContext?: boolean | undefined;
|
|
3
4
|
}
|
|
4
5
|
export declare function parseImportRequest(params: string): string | undefined;
|
|
5
6
|
export declare function hasLocalCssImport(rawSource: string): boolean;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
2
|
import type { GenerateBundleContext } from './types.js';
|
|
3
3
|
import type { IStyleHandlerOptions } from '../../../types/index.js';
|
|
4
|
+
export declare function finalizeMiniProgramCssAssetStructures(bundle: Record<string, OutputAsset | OutputChunk>, options: {
|
|
5
|
+
cssMatcher: GenerateBundleContext['opts']['cssMatcher'];
|
|
6
|
+
files?: ReadonlySet<string> | undefined;
|
|
7
|
+
isWebGeneratorTarget: boolean;
|
|
8
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
9
|
+
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
10
|
+
debug?: GenerateBundleContext['debug'];
|
|
11
|
+
}): number;
|
|
4
12
|
export declare function finalizeMiniProgramCssAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: {
|
|
5
13
|
cssMatcher: GenerateBundleContext['opts']['cssMatcher'];
|
|
6
14
|
getCssHandlerOptions: (file: string) => IStyleHandlerOptions;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { HmrContext, ModuleNode } from 'vite';
|
|
2
|
-
export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds: Iterable<string | null | undefined>): ModuleNode[]
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds: Iterable<string | null | undefined>): Promise<ModuleNode[]>;
|
|
3
|
+
export declare function resolveHotSourceModulesByIds(ctx: HmrContext, ids: Iterable<string | null | undefined>): Promise<ModuleNode[]>;
|
|
4
|
+
export declare function resolveHotSourceModules(ctx: HmrContext): Promise<ModuleNode[]>;
|
|
5
|
+
export declare function mergeHotModulesByIdentity(root: string, ...groups: ModuleNode[][]): ModuleNode[];
|
|
4
6
|
export declare function hasSelfAcceptingNonStyleHotModule(modules: ModuleNode[]): boolean;
|
|
5
|
-
export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[], fallbackCssIds?: Iterable<string>): void;
|
|
7
|
+
export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[], fallbackCssIds?: Iterable<string>, fallbackSourceIds?: Iterable<string>): void;
|
|
6
8
|
export declare function sendFullReloadForUnresolvedHotUpdate(ctx: HmrContext): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ViteModuleIdentity {
|
|
2
|
+
cleanId: string;
|
|
3
|
+
file: string | undefined;
|
|
4
|
+
key: string;
|
|
5
|
+
lookupFiles: string[];
|
|
6
|
+
lookupIds: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveViteModuleIdentity(id: string, root?: string): ViteModuleIdentity;
|
|
9
|
+
export declare function hasSameViteModuleIdentity(left: string | null | undefined, right: string | null | undefined, root?: string): boolean;
|
|
@@ -2,7 +2,6 @@ import type { OutputAsset, OutputBundle } from 'rollup';
|
|
|
2
2
|
import type { CollectViteProcessedCssAssetOptions } from './markers-imports.js';
|
|
3
3
|
export declare function restoreCssImportAtRules(source: string, filtered: string, file?: string): string;
|
|
4
4
|
export declare function removeCommentOnlyAtRules(css: string): string;
|
|
5
|
-
export declare function removeEmptyCssAtRules(css: string): string;
|
|
6
5
|
export declare function collectImportedBundleCssSources(bundle: OutputBundle, importedStyleFiles: Set<string>): string[];
|
|
7
6
|
export declare function collectBundleAssetFiles(bundle: OutputBundle): Set<string>;
|
|
8
7
|
export declare function resolveConfiguredCssEntryRootInjectionTarget(bundle: OutputBundle, options: Pick<CollectViteProcessedCssAssetOptions, 'cssPipelineStrategy' | 'createCssPipelineContext' | 'opts'>, sourceFile: string | undefined, outputFile: string): string | undefined;
|
|
@@ -31,6 +31,7 @@ export interface CollectViteProcessedCssAssetOptions {
|
|
|
31
31
|
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
32
32
|
recordViteProcessedCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
33
33
|
resolveViteProcessedCssOutputFile?: ((file: string) => string | undefined) | undefined;
|
|
34
|
+
onAssetWrite?: ((file: string) => void) | undefined;
|
|
34
35
|
subpackageRoots?: Set<string> | undefined;
|
|
35
36
|
transformCss?: ((css: string, file: string) => string) | undefined;
|
|
36
37
|
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { AtRule, Rule } from 'postcss';
|
|
2
2
|
export declare function hasVueScopedAttr(value: string): boolean;
|
|
3
3
|
export declare function normalizeCssSignatureValue(value: string): string;
|
|
4
|
+
export declare function isScopedUniversalTailwindPreflightRule(rule: Rule): boolean;
|
|
5
|
+
export declare function isScopedUniAppWebTailwindPreflightRule(rule: Rule): boolean;
|
|
6
|
+
export declare function hasScopedUniAppWebTailwindPreflightRule(css: string): boolean;
|
|
4
7
|
export declare function isLikelyTailwindGlobalRule(rule: Rule): boolean;
|
|
5
8
|
export declare function isLikelyTailwindPropertyAtRule(atRule: AtRule): boolean;
|
|
9
|
+
export declare function isLikelyTailwindLayerOrderAtRule(atRule: AtRule): boolean;
|
|
6
10
|
export declare function isUnscopedMiniProgramTailwindPreflightRule(rule: Rule): boolean;
|
|
7
11
|
export declare function isScopedMiniProgramTailwindContentInitRule(rule: Rule): boolean;
|
|
8
12
|
export declare function hasUnscopedMiniProgramTailwindPreflightRule(css: string): boolean;
|
|
@@ -14,6 +14,7 @@ interface ViteCssGenerationOptions {
|
|
|
14
14
|
onTailwindRootCss?: ((id: string, code: string) => Promise<void> | void) | undefined;
|
|
15
15
|
shouldGenerate: () => boolean;
|
|
16
16
|
shouldGenerateBuild?: (() => boolean) | undefined;
|
|
17
|
+
shouldDeferGeneration?: ((id: string, code: string) => boolean) | undefined;
|
|
17
18
|
}
|
|
18
19
|
export declare function createViteCssGenerationPlugins(options: ViteCssGenerationOptions): Plugin[];
|
|
19
20
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Plugin, ResolvedConfig } from 'vite';
|
|
1
|
+
import type { HmrContext, Plugin, ResolvedConfig } from 'vite';
|
|
2
2
|
import type { ViteFrameworkName } from '../../framework-selector.js';
|
|
3
3
|
import type { createViteRuntimeClassSet } from '../runtime-class-set.js';
|
|
4
4
|
import type { ViteFrameworkCssPipelineStrategy, ViteFrameworkExtraPluginPlatform, ViteFrameworkRuntimeFeatureContext } from './framework-strategy.js';
|
|
@@ -31,6 +31,7 @@ export interface ViteFrameworkExtraPluginContext {
|
|
|
31
31
|
mainCssChunkMatcher: ReturnType<typeof getCompilerContext>['mainCssChunkMatcher'];
|
|
32
32
|
runtimeState: ReturnType<typeof createViteRuntimeClassSet>['runtimeState'];
|
|
33
33
|
styleHandler: ReturnType<typeof getCompilerContext>['styleHandler'];
|
|
34
|
+
syncSourceCandidatesForHotUpdate: (ctx: HmrContext) => Promise<void>;
|
|
34
35
|
tailwindRootCssModuleIds: Set<string>;
|
|
35
36
|
uniAppX: ReturnType<typeof getCompilerContext>['uniAppX'];
|
|
36
37
|
viteProcessedCssSourceFiles: Iterable<string>;
|
|
@@ -23,6 +23,7 @@ interface CreateViteHmrCandidateStateOptions {
|
|
|
23
23
|
getCommand: () => string | undefined;
|
|
24
24
|
getGeneratorOptions: () => ViteHmrGeneratorOptions;
|
|
25
25
|
getSourceCandidate: (file: string) => string | undefined;
|
|
26
|
+
isRuntimeAffectingSource?: (file: string) => boolean;
|
|
26
27
|
}
|
|
27
28
|
export declare function createViteHmrCandidateState(options: CreateViteHmrCandidateStateOptions): {
|
|
28
29
|
apply: (change: ViteSourceCandidateChange) => ViteSourceCandidateChange;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HmrContext } from 'vite';
|
|
1
2
|
import type { createViteCssMemory } from '../css-memory.js';
|
|
2
3
|
import type { createViteRuntimeClassSet } from '../runtime-class-set.js';
|
|
3
4
|
import type { createSourceCandidateCollector } from '../source-candidates.js';
|
|
@@ -18,6 +19,7 @@ interface FrameworkSourceScanSessionOptions {
|
|
|
18
19
|
shouldOwnTailwindGeneration: boolean;
|
|
19
20
|
sourceCandidateCollector: SourceCandidateCollector;
|
|
20
21
|
}
|
|
22
|
+
export declare function syncFrameworkSourceCandidatesForHotUpdate(sourceScanSession: Pick<ReturnType<typeof createFrameworkSourceScanSession>, 'syncChangedFile' | 'waitForPendingSyncs'>, ctx: HmrContext): Promise<void>;
|
|
21
23
|
export declare function createFrameworkSourceScanSession(options: FrameworkSourceScanSessionOptions): {
|
|
22
24
|
cacheCurrent: () => void;
|
|
23
25
|
getStats: () => {
|
|
@@ -52,6 +52,10 @@ export interface ViteFrameworkCssPipelineStrategy {
|
|
|
52
52
|
};
|
|
53
53
|
generatorCode: string;
|
|
54
54
|
}) => boolean;
|
|
55
|
+
shouldDeferPreTransformTailwindGeneration?: (context: ViteFrameworkCssPipelineContext & {
|
|
56
|
+
code: string;
|
|
57
|
+
id: string;
|
|
58
|
+
}) => boolean;
|
|
55
59
|
shouldKeepRootMiniProgramStyleAsImportShell?: (context: ViteFrameworkCssPipelineContext & {
|
|
56
60
|
css: string;
|
|
57
61
|
file: string;
|
package/dist/cli.js
CHANGED
|
@@ -18,6 +18,7 @@ import "tailwindcss-config";
|
|
|
18
18
|
import _babelTraverse from "@babel/traverse";
|
|
19
19
|
import { parse } from "@babel/parser";
|
|
20
20
|
import MagicString from "magic-string";
|
|
21
|
+
import "oxc-walker";
|
|
21
22
|
import "@babel/types";
|
|
22
23
|
import "htmlparser2";
|
|
23
24
|
//#region src/js/babel/cache-options.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveMpxPlatform } from "./framework.js";
|
|
2
|
-
import { It as shouldUseUniAppWebRpxCompatibility, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, Rt as resolveValidTailwindV4Candidates$1, a as resolveGeneratorRuntimeBranch, d as resolveTailwindV4SourceFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions, k as resolveBooleanObjectOption, yt as createTailwindV4Engine$1 } from "./generator-
|
|
3
|
-
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-
|
|
2
|
+
import { It as shouldUseUniAppWebRpxCompatibility, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, Rt as resolveValidTailwindV4Candidates$1, a as resolveGeneratorRuntimeBranch, d as resolveTailwindV4SourceFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions, k as resolveBooleanObjectOption, yt as createTailwindV4Engine$1 } from "./generator-BLpOsd5O.js";
|
|
3
|
+
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-2zdmASlM.js";
|
|
4
4
|
import { i as isMap, n as defuOverrideArray } from "./utils-MVwpU07P.js";
|
|
5
5
|
import { a as jsHandler, c as getReplacementCacheStore, d as decodeUnicode2, f as resolveClassNameTransformWithResult, h as createDebug, l as jsStringEscape, p as shouldEnableArbitraryValueFallback, s as getReplacement, t as createTemplateHandler, v as md5Hash } from "./wxml-IBzZSaQC.js";
|
|
6
6
|
import { getDefaultOptions, resolveDefaultCssPreflight } from "./defaults.js";
|
|
@@ -14,6 +14,7 @@ import { rm } from "node:fs/promises";
|
|
|
14
14
|
import MagicString from "magic-string";
|
|
15
15
|
import { logger, pc } from "@weapp-tailwindcss/logger";
|
|
16
16
|
import { Buffer } from "node:buffer";
|
|
17
|
+
import { walk } from "oxc-walker";
|
|
17
18
|
//#region src/cache/index.ts
|
|
18
19
|
function isProcessResult(value) {
|
|
19
20
|
return typeof value === "object" && value !== null && "result" in value;
|
|
@@ -640,7 +641,6 @@ function transformLiteralText(literal, options) {
|
|
|
640
641
|
//#region src/js/fast-path/oxc.ts
|
|
641
642
|
const require = createRequire(import.meta.url);
|
|
642
643
|
let oxcParser;
|
|
643
|
-
let oxcWalker;
|
|
644
644
|
function isOxcParserRuntimeSupported(version = process.versions.node) {
|
|
645
645
|
const match = /^(\d+)\.(\d+)(?:\.|$)/.exec(version);
|
|
646
646
|
if (!match) return false;
|
|
@@ -663,18 +663,6 @@ function loadOxcParser() {
|
|
|
663
663
|
}
|
|
664
664
|
return oxcParser;
|
|
665
665
|
}
|
|
666
|
-
function loadOxcWalker() {
|
|
667
|
-
if (!isOxcParserRuntimeSupported()) return;
|
|
668
|
-
if (oxcWalker === false) return;
|
|
669
|
-
if (oxcWalker) return oxcWalker;
|
|
670
|
-
try {
|
|
671
|
-
oxcWalker = require("oxc-walker");
|
|
672
|
-
} catch {
|
|
673
|
-
oxcWalker = false;
|
|
674
|
-
return;
|
|
675
|
-
}
|
|
676
|
-
return oxcWalker;
|
|
677
|
-
}
|
|
678
666
|
function hasValues(values) {
|
|
679
667
|
return Array.isArray(values) && values.length > 0;
|
|
680
668
|
}
|
|
@@ -727,9 +715,9 @@ function addTemplateElementReplacement(rawSource, node, transformOptions, contex
|
|
|
727
715
|
getMagicString(rawSource, context).update(start, end, transformed);
|
|
728
716
|
return true;
|
|
729
717
|
}
|
|
730
|
-
function applyReplacements(rawSource, program,
|
|
718
|
+
function applyReplacements(rawSource, program, stringLiteralOptions, templateLiteralOptions, context) {
|
|
731
719
|
let changed = false;
|
|
732
|
-
|
|
720
|
+
walk(program, { enter(node) {
|
|
733
721
|
if (node.type === "Literal") {
|
|
734
722
|
changed = addStringLiteralReplacement(rawSource, node, stringLiteralOptions, context) || changed;
|
|
735
723
|
return;
|
|
@@ -741,9 +729,9 @@ function applyReplacements(rawSource, program, walker, stringLiteralOptions, tem
|
|
|
741
729
|
} });
|
|
742
730
|
return changed;
|
|
743
731
|
}
|
|
744
|
-
function hasTaggedTemplateExpression(program
|
|
732
|
+
function hasTaggedTemplateExpression(program) {
|
|
745
733
|
let found = false;
|
|
746
|
-
|
|
734
|
+
walk(program, { enter(node) {
|
|
747
735
|
if (node.type === "TaggedTemplateExpression") {
|
|
748
736
|
found = true;
|
|
749
737
|
this.skip();
|
|
@@ -755,8 +743,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
755
743
|
if (!canAttemptOxcJsFastPath(options)) return;
|
|
756
744
|
if (hasUnsupportedSourceMarker(rawSource)) return;
|
|
757
745
|
const parser = loadOxcParser();
|
|
758
|
-
|
|
759
|
-
if (!parser || !walker) return;
|
|
746
|
+
if (!parser) return;
|
|
760
747
|
let result;
|
|
761
748
|
try {
|
|
762
749
|
result = parser.parseSync(options.filename ?? "weapp-tailwindcss.js", rawSource, {
|
|
@@ -767,7 +754,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
767
754
|
return;
|
|
768
755
|
}
|
|
769
756
|
if (!result.program || Array.isArray(result.errors) && result.errors.length > 0) return;
|
|
770
|
-
if (hasValues(options.ignoreTaggedTemplateExpressionIdentifiers) && hasTaggedTemplateExpression(result.program
|
|
757
|
+
if (hasValues(options.ignoreTaggedTemplateExpressionIdentifiers) && hasTaggedTemplateExpression(result.program)) return;
|
|
771
758
|
const stringLiteralOptions = options.needEscaped === true ? options : {
|
|
772
759
|
...options,
|
|
773
760
|
needEscaped: true
|
|
@@ -777,7 +764,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
777
764
|
needEscaped: false
|
|
778
765
|
};
|
|
779
766
|
const replacementContext = {};
|
|
780
|
-
if (!applyReplacements(rawSource, result.program,
|
|
767
|
+
if (!applyReplacements(rawSource, result.program, stringLiteralOptions, templateLiteralOptions, replacementContext)) return { code: rawSource };
|
|
781
768
|
return { code: replacementContext.ms.toString() };
|
|
782
769
|
}
|
|
783
770
|
//#endregion
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const
|
|
3
|
+
const require_generator = require("./generator-B0dCFlP1.cjs");
|
|
4
|
+
const require_object = require("./object-C_Vr6_S5.cjs");
|
|
5
|
+
const require_options = require("./options-zpZez7qe.cjs");
|
|
5
6
|
require("./utils-CuKLf1Zv.cjs");
|
|
6
7
|
const require_wxml = require("./wxml-DSMNuUaP.cjs");
|
|
7
8
|
const require_defaults = require("./defaults.cjs");
|
|
8
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
9
|
-
const require_style_options = require("./style-options-
|
|
9
|
+
const require_tailwindcss = require("./tailwindcss-LtnGCxF0.cjs");
|
|
10
|
+
const require_style_options = require("./style-options-COpQc8fr.cjs");
|
|
10
11
|
let node_path = require("node:path");
|
|
11
12
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
12
13
|
let node_process = require("node:process");
|
|
@@ -616,6 +617,173 @@ function toCustomAttributesEntities(customAttributes) {
|
|
|
616
617
|
return Object.entries(customAttributes);
|
|
617
618
|
}
|
|
618
619
|
//#endregion
|
|
620
|
+
//#region ../../node_modules/.pnpm/oxc-walker@1.1.1_@oxc-project+types@0.142.0_oxc-parser@0.142.0_rolldown@1.2.0/node_modules/oxc-walker/dist/index.mjs
|
|
621
|
+
function isNode(v) {
|
|
622
|
+
return v !== null && typeof v === "object" && typeof v.type === "string";
|
|
623
|
+
}
|
|
624
|
+
var WalkerBase = class {
|
|
625
|
+
constructor(handler, options) {
|
|
626
|
+
require_object._defineProperty(this, "scopeTracker", void 0);
|
|
627
|
+
require_object._defineProperty(this, "enter", void 0);
|
|
628
|
+
require_object._defineProperty(this, "leave", void 0);
|
|
629
|
+
require_object._defineProperty(this, "contextEnter", {
|
|
630
|
+
skip: () => {
|
|
631
|
+
this._skip = true;
|
|
632
|
+
},
|
|
633
|
+
remove: () => {
|
|
634
|
+
this._remove = true;
|
|
635
|
+
},
|
|
636
|
+
replace: (node) => {
|
|
637
|
+
this._replacement = node;
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
require_object._defineProperty(this, "contextLeave", {
|
|
641
|
+
remove: this.contextEnter.remove,
|
|
642
|
+
replace: this.contextEnter.replace
|
|
643
|
+
});
|
|
644
|
+
require_object._defineProperty(this, "_skip", false);
|
|
645
|
+
require_object._defineProperty(this, "_remove", false);
|
|
646
|
+
require_object._defineProperty(this, "_replacement", null);
|
|
647
|
+
this.enter = handler.enter;
|
|
648
|
+
this.leave = handler.leave;
|
|
649
|
+
this.scopeTracker = options?.scopeTracker;
|
|
650
|
+
}
|
|
651
|
+
replace(parent, key, index, node) {
|
|
652
|
+
if (!parent || key === null) return;
|
|
653
|
+
if (index !== null) parent[key][index] = node;
|
|
654
|
+
else parent[key] = node;
|
|
655
|
+
}
|
|
656
|
+
insert(parent, key, index, node) {
|
|
657
|
+
if (!parent || key === null) return;
|
|
658
|
+
if (index !== null) parent[key].splice(index, 0, node);
|
|
659
|
+
else parent[key] = node;
|
|
660
|
+
}
|
|
661
|
+
remove(parent, key, index) {
|
|
662
|
+
if (!parent || key === null) return;
|
|
663
|
+
if (index !== null) parent[key].splice(index, 1);
|
|
664
|
+
else delete parent[key];
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
var WalkerSync = class extends WalkerBase {
|
|
668
|
+
constructor(handler, options) {
|
|
669
|
+
super(handler, options);
|
|
670
|
+
}
|
|
671
|
+
traverse(input, key, index, parent) {
|
|
672
|
+
const ctx = {
|
|
673
|
+
key: null,
|
|
674
|
+
index: index ?? null,
|
|
675
|
+
ast: input
|
|
676
|
+
};
|
|
677
|
+
const scopeTracker = this.scopeTracker;
|
|
678
|
+
const enter = this.enter;
|
|
679
|
+
const leave = this.leave;
|
|
680
|
+
const contextEnter = this.contextEnter;
|
|
681
|
+
const contextLeave = this.contextLeave;
|
|
682
|
+
const _walk = (input, parent, key, index, skip) => {
|
|
683
|
+
if (scopeTracker) scopeTracker.processNodeEnter(input);
|
|
684
|
+
let currentNode = input;
|
|
685
|
+
let removedInEnter = false;
|
|
686
|
+
let replacedInEnter = false;
|
|
687
|
+
let skipChildren = skip;
|
|
688
|
+
if (enter && !skip) {
|
|
689
|
+
const _skip = this._skip;
|
|
690
|
+
const _remove = this._remove;
|
|
691
|
+
const _replacement = this._replacement;
|
|
692
|
+
this._skip = false;
|
|
693
|
+
this._remove = false;
|
|
694
|
+
this._replacement = null;
|
|
695
|
+
ctx.key = key;
|
|
696
|
+
ctx.index = index;
|
|
697
|
+
enter.call(contextEnter, input, parent, ctx);
|
|
698
|
+
if (this._replacement && !this._remove) {
|
|
699
|
+
currentNode = this._replacement;
|
|
700
|
+
replacedInEnter = true;
|
|
701
|
+
this.replace(parent, key, index, this._replacement);
|
|
702
|
+
if (scopeTracker) scopeTracker.processNodeEnter(currentNode);
|
|
703
|
+
}
|
|
704
|
+
if (this._remove) {
|
|
705
|
+
removedInEnter = true;
|
|
706
|
+
currentNode = null;
|
|
707
|
+
this.remove(parent, key, index);
|
|
708
|
+
}
|
|
709
|
+
if (this._skip) skipChildren = true;
|
|
710
|
+
this._skip = _skip;
|
|
711
|
+
this._remove = _remove;
|
|
712
|
+
this._replacement = _replacement;
|
|
713
|
+
}
|
|
714
|
+
if ((!skipChildren || scopeTracker) && currentNode) for (const k in currentNode) {
|
|
715
|
+
if (k === "type" || k === "start" || k === "end") continue;
|
|
716
|
+
const node = currentNode[k];
|
|
717
|
+
if (!node || typeof node !== "object") continue;
|
|
718
|
+
if (Array.isArray(node)) for (let i = 0; i < node.length; i++) {
|
|
719
|
+
const child = node[i];
|
|
720
|
+
if (isNode(child)) {
|
|
721
|
+
if (_walk(child, currentNode, k, i, skipChildren) === null) i--;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
else if (typeof node.type === "string") _walk(node, currentNode, k, null, skipChildren);
|
|
725
|
+
}
|
|
726
|
+
if (scopeTracker) {
|
|
727
|
+
if (replacedInEnter) scopeTracker.processNodeLeave(currentNode);
|
|
728
|
+
scopeTracker.processNodeLeave(input);
|
|
729
|
+
}
|
|
730
|
+
if (leave && !skip) {
|
|
731
|
+
const _replacement = this._replacement;
|
|
732
|
+
const _remove = this._remove;
|
|
733
|
+
this._replacement = null;
|
|
734
|
+
this._remove = false;
|
|
735
|
+
ctx.key = key;
|
|
736
|
+
ctx.index = index;
|
|
737
|
+
leave.call(contextLeave, input, parent, ctx);
|
|
738
|
+
if (this._replacement && !this._remove) {
|
|
739
|
+
currentNode = this._replacement;
|
|
740
|
+
if (removedInEnter) this.insert(parent, key, index, this._replacement);
|
|
741
|
+
else this.replace(parent, key, index, this._replacement);
|
|
742
|
+
}
|
|
743
|
+
if (this._remove) {
|
|
744
|
+
currentNode = null;
|
|
745
|
+
this.remove(parent, key, index);
|
|
746
|
+
}
|
|
747
|
+
this._replacement = _replacement;
|
|
748
|
+
this._remove = _remove;
|
|
749
|
+
}
|
|
750
|
+
return currentNode;
|
|
751
|
+
};
|
|
752
|
+
if (!isNode(input)) return null;
|
|
753
|
+
if (scopeTracker) scopeTracker.onWalkStart(input);
|
|
754
|
+
if (scopeTracker && !enter && !leave) {
|
|
755
|
+
const _walkScopesOnly = (input) => {
|
|
756
|
+
scopeTracker.processNodeEnter(input);
|
|
757
|
+
for (const k in input) {
|
|
758
|
+
if (k === "type" || k === "start" || k === "end") continue;
|
|
759
|
+
const node = input[k];
|
|
760
|
+
if (!node || typeof node !== "object") continue;
|
|
761
|
+
if (Array.isArray(node)) for (let i = 0; i < node.length; i++) {
|
|
762
|
+
const child = node[i];
|
|
763
|
+
if (isNode(child)) _walkScopesOnly(child);
|
|
764
|
+
}
|
|
765
|
+
else if (typeof node.type === "string") _walkScopesOnly(node);
|
|
766
|
+
}
|
|
767
|
+
scopeTracker.processNodeLeave(input);
|
|
768
|
+
};
|
|
769
|
+
_walkScopesOnly(input);
|
|
770
|
+
return input;
|
|
771
|
+
}
|
|
772
|
+
return _walk(input, parent ?? null, key ?? null, index ?? null, false);
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* Walk the AST with the given options.
|
|
777
|
+
* @param input The AST to walk.
|
|
778
|
+
* @param options The options to be used when walking the AST. Here you can specify the callbacks for entering and leaving nodes, as well as other options.
|
|
779
|
+
*/
|
|
780
|
+
function walk(input, options) {
|
|
781
|
+
return new WalkerSync({
|
|
782
|
+
enter: options.enter,
|
|
783
|
+
leave: options.leave
|
|
784
|
+
}, { scopeTracker: options.scopeTracker }).traverse(input);
|
|
785
|
+
}
|
|
786
|
+
//#endregion
|
|
619
787
|
//#region src/js/literal-transform.ts
|
|
620
788
|
function transformLiteralText(literal, options) {
|
|
621
789
|
const fallbackEnabled = require_wxml.shouldEnableArbitraryValueFallback(options);
|
|
@@ -646,7 +814,6 @@ function transformLiteralText(literal, options) {
|
|
|
646
814
|
//#region src/js/fast-path/oxc.ts
|
|
647
815
|
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
648
816
|
let oxcParser;
|
|
649
|
-
let oxcWalker;
|
|
650
817
|
function isOxcParserRuntimeSupported(version = node_process.default.versions.node) {
|
|
651
818
|
const match = /^(\d+)\.(\d+)(?:\.|$)/.exec(version);
|
|
652
819
|
if (!match) return false;
|
|
@@ -669,18 +836,6 @@ function loadOxcParser() {
|
|
|
669
836
|
}
|
|
670
837
|
return oxcParser;
|
|
671
838
|
}
|
|
672
|
-
function loadOxcWalker() {
|
|
673
|
-
if (!isOxcParserRuntimeSupported()) return;
|
|
674
|
-
if (oxcWalker === false) return;
|
|
675
|
-
if (oxcWalker) return oxcWalker;
|
|
676
|
-
try {
|
|
677
|
-
oxcWalker = require$1("oxc-walker");
|
|
678
|
-
} catch {
|
|
679
|
-
oxcWalker = false;
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
return oxcWalker;
|
|
683
|
-
}
|
|
684
839
|
function hasValues(values) {
|
|
685
840
|
return Array.isArray(values) && values.length > 0;
|
|
686
841
|
}
|
|
@@ -733,9 +888,9 @@ function addTemplateElementReplacement(rawSource, node, transformOptions, contex
|
|
|
733
888
|
getMagicString(rawSource, context).update(start, end, transformed);
|
|
734
889
|
return true;
|
|
735
890
|
}
|
|
736
|
-
function applyReplacements(rawSource, program,
|
|
891
|
+
function applyReplacements(rawSource, program, stringLiteralOptions, templateLiteralOptions, context) {
|
|
737
892
|
let changed = false;
|
|
738
|
-
|
|
893
|
+
walk(program, { enter(node) {
|
|
739
894
|
if (node.type === "Literal") {
|
|
740
895
|
changed = addStringLiteralReplacement(rawSource, node, stringLiteralOptions, context) || changed;
|
|
741
896
|
return;
|
|
@@ -747,9 +902,9 @@ function applyReplacements(rawSource, program, walker, stringLiteralOptions, tem
|
|
|
747
902
|
} });
|
|
748
903
|
return changed;
|
|
749
904
|
}
|
|
750
|
-
function hasTaggedTemplateExpression(program
|
|
905
|
+
function hasTaggedTemplateExpression(program) {
|
|
751
906
|
let found = false;
|
|
752
|
-
|
|
907
|
+
walk(program, { enter(node) {
|
|
753
908
|
if (node.type === "TaggedTemplateExpression") {
|
|
754
909
|
found = true;
|
|
755
910
|
this.skip();
|
|
@@ -761,8 +916,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
761
916
|
if (!canAttemptOxcJsFastPath(options)) return;
|
|
762
917
|
if (hasUnsupportedSourceMarker(rawSource)) return;
|
|
763
918
|
const parser = loadOxcParser();
|
|
764
|
-
|
|
765
|
-
if (!parser || !walker) return;
|
|
919
|
+
if (!parser) return;
|
|
766
920
|
let result;
|
|
767
921
|
try {
|
|
768
922
|
result = parser.parseSync(options.filename ?? "weapp-tailwindcss.js", rawSource, {
|
|
@@ -773,7 +927,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
773
927
|
return;
|
|
774
928
|
}
|
|
775
929
|
if (!result.program || Array.isArray(result.errors) && result.errors.length > 0) return;
|
|
776
|
-
if (hasValues(options.ignoreTaggedTemplateExpressionIdentifiers) && hasTaggedTemplateExpression(result.program
|
|
930
|
+
if (hasValues(options.ignoreTaggedTemplateExpressionIdentifiers) && hasTaggedTemplateExpression(result.program)) return;
|
|
777
931
|
const stringLiteralOptions = options.needEscaped === true ? options : {
|
|
778
932
|
...options,
|
|
779
933
|
needEscaped: true
|
|
@@ -783,7 +937,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
783
937
|
needEscaped: false
|
|
784
938
|
};
|
|
785
939
|
const replacementContext = {};
|
|
786
|
-
if (!applyReplacements(rawSource, result.program,
|
|
940
|
+
if (!applyReplacements(rawSource, result.program, stringLiteralOptions, templateLiteralOptions, replacementContext)) return { code: rawSource };
|
|
787
941
|
return { code: replacementContext.ms.toString() };
|
|
788
942
|
}
|
|
789
943
|
//#endregion
|
package/dist/core.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_context = require("./context-
|
|
2
|
+
const require_context = require("./context-CByXWyhQ.cjs");
|
|
3
3
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
4
4
|
//#region src/core.ts
|
|
5
5
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-
|
|
1
|
+
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-BMkbwnH8.js";
|
|
2
2
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
3
3
|
//#region src/core.ts
|
|
4
4
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
|
@@ -1698,6 +1698,15 @@ const TAILWIND_REMOVABLE_SOURCE_DIRECTIVE_NAMES = /* @__PURE__ */ new Set([
|
|
|
1698
1698
|
"utility",
|
|
1699
1699
|
"variant"
|
|
1700
1700
|
]);
|
|
1701
|
+
const TAILWIND_APPLY_CONTEXT_DIRECTIVE_NAMES = /* @__PURE__ */ new Set([
|
|
1702
|
+
"config",
|
|
1703
|
+
"custom-variant",
|
|
1704
|
+
"plugin",
|
|
1705
|
+
"reference",
|
|
1706
|
+
"theme",
|
|
1707
|
+
"utility",
|
|
1708
|
+
"variant"
|
|
1709
|
+
]);
|
|
1701
1710
|
const TAILWIND_ROOT_DIRECTIVE_RE = /@(?:import\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|(?:use|forward)\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|tailwind|config|custom-variant|plugin|source|theme|utility|variant)\b/;
|
|
1702
1711
|
function parseImportRequest(params) {
|
|
1703
1712
|
return (0, _weapp_tailwindcss_postcss.parseTailwindCssDirectiveRequest)(params);
|
|
@@ -1780,6 +1789,7 @@ function isTailwindSourceDirective(node, options = {}) {
|
|
|
1780
1789
|
if (isTailwindImportAtRule(atRule, options)) return true;
|
|
1781
1790
|
if (atRule.name === "import" && isPackageJsonImportRequest(parseImportRequest(atRule.params))) return true;
|
|
1782
1791
|
if (atRule.name === "layer") return !atRule.nodes || atRule.nodes.length === 0;
|
|
1792
|
+
if (options.preserveApplyContext && TAILWIND_APPLY_CONTEXT_DIRECTIVE_NAMES.has(atRule.name)) return false;
|
|
1783
1793
|
return TAILWIND_REMOVABLE_SOURCE_DIRECTIVE_NAMES.has(atRule.name);
|
|
1784
1794
|
}
|
|
1785
1795
|
function hasGeneratedCssArtifacts(rawSource) {
|
|
@@ -1693,6 +1693,15 @@ const TAILWIND_REMOVABLE_SOURCE_DIRECTIVE_NAMES = /* @__PURE__ */ new Set([
|
|
|
1693
1693
|
"utility",
|
|
1694
1694
|
"variant"
|
|
1695
1695
|
]);
|
|
1696
|
+
const TAILWIND_APPLY_CONTEXT_DIRECTIVE_NAMES = /* @__PURE__ */ new Set([
|
|
1697
|
+
"config",
|
|
1698
|
+
"custom-variant",
|
|
1699
|
+
"plugin",
|
|
1700
|
+
"reference",
|
|
1701
|
+
"theme",
|
|
1702
|
+
"utility",
|
|
1703
|
+
"variant"
|
|
1704
|
+
]);
|
|
1696
1705
|
const TAILWIND_ROOT_DIRECTIVE_RE = /@(?:import\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|(?:use|forward)\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|tailwind|config|custom-variant|plugin|source|theme|utility|variant)\b/;
|
|
1697
1706
|
function parseImportRequest(params) {
|
|
1698
1707
|
return parseTailwindCssDirectiveRequest(params);
|
|
@@ -1775,6 +1784,7 @@ function isTailwindSourceDirective(node, options = {}) {
|
|
|
1775
1784
|
if (isTailwindImportAtRule(atRule, options)) return true;
|
|
1776
1785
|
if (atRule.name === "import" && isPackageJsonImportRequest(parseImportRequest(atRule.params))) return true;
|
|
1777
1786
|
if (atRule.name === "layer") return !atRule.nodes || atRule.nodes.length === 0;
|
|
1787
|
+
if (options.preserveApplyContext && TAILWIND_APPLY_CONTEXT_DIRECTIVE_NAMES.has(atRule.name)) return false;
|
|
1778
1788
|
return TAILWIND_REMOVABLE_SOURCE_DIRECTIVE_NAMES.has(atRule.name);
|
|
1779
1789
|
}
|
|
1780
1790
|
function hasGeneratedCssArtifacts(rawSource) {
|
package/dist/generator.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-B0dCFlP1.cjs");
|
|
3
3
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
4
4
|
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
|
5
5
|
exports.normalizeWeappTailwindcssGeneratorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions;
|
package/dist/generator.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Mt as transformTailwindV4CssToWeapp, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, jt as transformTailwindV4CssByTarget, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-
|
|
1
|
+
import { Mt as transformTailwindV4CssToWeapp, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, jt as transformTailwindV4CssByTarget, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-BLpOsd5O.js";
|
|
2
2
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Pt as getTailwindV4IncrementalGenerateCacheStats, Q as hasTailwindRootDirectives, _ as upsertTailwindV4CssSource, et as normalizeTailwindConfigDirectives, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, nt as normalizeTailwindSourceForGenerator, vt as prependConfigDirective } from "./generator-
|
|
2
|
-
import { l as getRuntimeClassSetSignature, p as resolveSourceScanEntries } from "./tailwindcss-
|
|
3
|
-
import { $ as
|
|
1
|
+
import { Pt as getTailwindV4IncrementalGenerateCacheStats, Q as hasTailwindRootDirectives, _ as upsertTailwindV4CssSource, et as normalizeTailwindConfigDirectives, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, nt as normalizeTailwindSourceForGenerator, vt as prependConfigDirective } from "./generator-BLpOsd5O.js";
|
|
2
|
+
import { l as getRuntimeClassSetSignature, p as resolveSourceScanEntries } from "./tailwindcss-2zdmASlM.js";
|
|
3
|
+
import { $ as invalidateCompilationScope, A as createCssSourceTraceCacheSignature, B as finalizeCompilerShadowRun, C as createBundlerGeneratedCssMarker, D as finalizeMiniProgramCssStructure, E as stripBundlerGeneratedCssMarkers, J as disposeCompilerOwner, K as updateRuntimeCompilationBuildState, N as processCachedTask, P as createRuntimeClassSetManager, Q as getCompilationScopeDependencyRevision, R as rewriteLocalCssImportRequestsForOutput, U as createRuntimeCompilationBuildState, V as buildRuntimeCompilationSnapshot, W as removeRuntimeCompilationBuildStateFiles, X as getCompilerShadowRunSnapshot, Y as beginCompilerShadowRun, Z as AssetEmissionPlan, et as recordCompilationDependencyChanges, j as createCssTokenSourceMap, k as annotateCssSourceTrace, n as emitHmrTiming, nt as createSourceCandidateCollector, q as createRuntimeAffectingSourceSignature, r as generateTailwindV4Css, tt as createCompilationDependencyChanges, w as hasBundlerGeneratedCssMarker, y as finalizeMiniProgramGeneratorCss, z as splitLocalCssImports } from "./hmr-timing-CJocHeZr.js";
|
|
4
4
|
import { h as createDebug } from "./wxml-IBzZSaQC.js";
|
|
5
|
-
import { l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-
|
|
5
|
+
import { l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-BMkbwnH8.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
@@ -252,7 +252,7 @@ function createGulpFileTransforms(context) {
|
|
|
252
252
|
const generatedCss = stage === "generate" && generated ? `${createBundlerGeneratedCssMarker("gulp", file.path)}\n${css}` : css;
|
|
253
253
|
const outputCss = stage === "generate" ? generatedCss : rewriteLocalCssImportRequestsForOutput(generatedCss, { styleOutputExtension });
|
|
254
254
|
debug("css handle: %s", file.path);
|
|
255
|
-
return { result: outputCss };
|
|
255
|
+
return { result: stage === "transform" ? finalizeMiniProgramCssStructure(outputCss) : outputCss };
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
@@ -270,11 +270,11 @@ function createGulpFileTransforms(context) {
|
|
|
270
270
|
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, source, options);
|
|
271
271
|
const handled = await styleHandler(source, cssHandlerOptions);
|
|
272
272
|
const preflightMode = generatedCssPreflightModeByFile.get(file.path);
|
|
273
|
-
writeGulpFileAsset(file, rewriteLocalCssImportRequestsForOutput(generatedCss ? finalizeMiniProgramGeneratorCss(handled.css, "weapp", runtimeState.tailwindRuntime.majorVersion, opts.cssPreflight, {
|
|
273
|
+
writeGulpFileAsset(file, finalizeMiniProgramCssStructure(rewriteLocalCssImportRequestsForOutput(generatedCss ? finalizeMiniProgramGeneratorCss(handled.css, "weapp", runtimeState.tailwindRuntime.majorVersion, opts.cssPreflight, {
|
|
274
274
|
injectPreflight: preflightMode?.inject ?? cssHandlerOptions.isMainChunk,
|
|
275
275
|
preservePreflight: preflightMode?.preserve ?? cssHandlerOptions.isMainChunk,
|
|
276
276
|
styleOptions: cssHandlerOptions
|
|
277
|
-
}) : handled.css, { styleOutputExtension }));
|
|
277
|
+
}) : handled.css, { styleOutputExtension })));
|
|
278
278
|
debug("css adapt: %s", file.path);
|
|
279
279
|
}, () => resolveGulpTransformTimingDetails("css:adapt"));
|
|
280
280
|
const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
|