weapp-tailwindcss 5.1.9 → 5.1.11
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/generator-css/generation-helpers.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/types.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +1 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +7 -2
- package/dist/bundlers/vite/web-css-compat.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +3 -0
- package/dist/cli.js +3 -2
- package/dist/cli.mjs +2 -1
- package/dist/{context-CfXr3hWz.mjs → context-DzkSFEVL.mjs} +4 -4
- package/dist/{context-CRhUs_5e.js → context-y2BGCok4.js} +10 -10
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/generator/options.d.ts +8 -1
- package/dist/{v4-engine-BZP2462H.js → generator-Bz94KTkH.js} +229 -17
- package/dist/{v4-engine-CjjWONB0.mjs → generator-ROzBodj6.mjs} +185 -9
- package/dist/generator.js +7 -8
- package/dist/generator.mjs +1 -2
- package/dist/{gulp-CRjkPsbX.mjs → gulp-BKqMb_Ds.mjs} +4 -4
- package/dist/{gulp-JUfnhOOo.js → gulp-DfOLvYLs.js} +10 -10
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DcIEXnf8.js → hmr-timing-DOTdH18A.js} +556 -170
- package/dist/{hmr-timing-BecOXMd8.mjs → hmr-timing-DwtYJdwb.mjs} +430 -56
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +2 -3
- package/dist/postcss.mjs +1 -2
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +5 -4
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-10tvdJVC.js → source-candidate-scan-signature-BrWuBTjY.js} +34 -6
- package/dist/{source-candidate-scan-signature-DAg8QSgh.mjs → source-candidate-scan-signature-CQ04hiox.mjs} +29 -7
- package/dist/{tailwindcss-BZjZZi60.js → tailwindcss-Dn5DVlkI.js} +55 -47
- package/dist/{tailwindcss-PA2jHHpx.mjs → tailwindcss-hzy_WaC9.mjs} +14 -6
- package/dist/{transform-wNEbcZeQ.mjs → transform-BgnNYkIG.mjs} +1 -1
- package/dist/{transform-B0BxX3XB.js → transform-DZQETx51.js} +1 -1
- package/dist/{vite-CHk7V9EA.js → vite-DODC15Fr.js} +865 -254
- package/dist/{vite-ClpyoD9e.mjs → vite-oI2ReOic.mjs} +818 -207
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +613 -63
- package/dist/{webpack-2s-TFhgm.mjs → webpack-CCapGlNg.mjs} +235 -38
- package/dist/{webpack-BhM4Hqla.js → webpack-XxBCIrBp.js} +276 -79
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +5 -5
- package/dist/generator-DaaFxR5V.js +0 -174
- package/dist/generator-DugIHBgl.mjs +0 -127
|
@@ -46,6 +46,7 @@ export declare function isEmptyCssSourceOrderParts(parts: {
|
|
|
46
46
|
}): boolean;
|
|
47
47
|
export declare function resolveGeneratorStyleOptions(opts: InternalUserDefinedOptions, cssHandlerOptions: IStyleHandlerOptions, generatorStyleOptions: Partial<IStyleHandlerOptions> | undefined): Partial<IStyleHandlerOptions>;
|
|
48
48
|
export declare function createCssSourceOrderAppend(base: string, extra: string): string;
|
|
49
|
+
export declare function deduplicateGeneratedCssRules(css: string): string;
|
|
49
50
|
export declare function shouldFinalizeMarkedUserLayerComponentsCss(file: string): boolean;
|
|
50
51
|
export declare function splitRawSourceByGeneratedCssOrder(rawSource: string, rawTailwindCss: string): {
|
|
51
52
|
before: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function normalizeMiniProgramImportShell(css: string): string;
|
|
2
|
+
export declare function removeSelfMiniProgramOutputImports(css: string, outputFile: string): string;
|
|
3
|
+
export declare function removeMiniProgramOutputImports(css: string): string;
|
|
4
|
+
export declare function normalizeMiniProgramGeneratorCssSource(css: string, outputFile?: string | undefined): string;
|
|
@@ -2,6 +2,7 @@ import type { SourceSideCssEntrySource } from '../source-files';
|
|
|
2
2
|
import type { TailwindResolvedSource } from '../../../../generator';
|
|
3
3
|
import type { TailwindSourceEntry } from '../../../../tailwindcss/source-scan';
|
|
4
4
|
export interface GeneratorSourceMetadata {
|
|
5
|
+
candidateMatchedCssSource?: boolean | undefined;
|
|
5
6
|
cssEntryIndex?: number | undefined;
|
|
6
7
|
cssSourceIndex?: number | undefined;
|
|
7
8
|
includesPreflight?: boolean | undefined;
|
|
@@ -23,7 +23,9 @@ export interface GenerateCssByGeneratorOptions {
|
|
|
23
23
|
userRawSourceProcessed?: boolean | undefined;
|
|
24
24
|
forceGenerator?: boolean | undefined;
|
|
25
25
|
previousCss?: string | undefined;
|
|
26
|
+
previousClassSet?: Set<string> | undefined;
|
|
26
27
|
deferEmptyScopedCssSource?: boolean | undefined;
|
|
28
|
+
disableSourceScan?: boolean | undefined;
|
|
27
29
|
restoreLocalCssImports?: boolean | undefined;
|
|
28
30
|
}
|
|
29
31
|
export interface GenerateCssByGeneratorResult {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { OutputAsset } from 'rollup';
|
|
2
2
|
import type { GenerateBundleThis } from './types';
|
|
3
|
-
export declare function createCssAssetEmitter(context: Pick<GenerateBundleThis, 'emitFile'>): (fileName: string, source: string) => OutputAsset | undefined;
|
|
3
|
+
export declare function createCssAssetEmitter(context: Pick<GenerateBundleThis, 'emitFile'>, bundle?: Record<string, OutputAsset | unknown> | undefined): (fileName: string, source: string) => OutputAsset | undefined;
|
|
4
4
|
export declare function resolveAssetSourceFile(asset: OutputAsset, fallbackFile: string): string;
|
|
@@ -6,6 +6,7 @@ interface ProcessRememberedCssReplayOptions {
|
|
|
6
6
|
bundle: Record<string, OutputAsset | OutputChunk>;
|
|
7
7
|
bundleFiles: string[];
|
|
8
8
|
cache: GenerateBundleContext['opts']['cache'];
|
|
9
|
+
changedCssFiles: Set<string>;
|
|
9
10
|
createScopedGeneratorRuntime: (outputFile: string, cssHandlerOptions: {
|
|
10
11
|
isMainChunk?: boolean | undefined;
|
|
11
12
|
}, runtime: Set<string>, rawSource?: string | undefined, sourceFile?: string | undefined) => Promise<Set<string>>;
|
|
@@ -27,6 +28,7 @@ interface ProcessRememberedCssReplayOptions {
|
|
|
27
28
|
getRememberedCssSources?: (() => Iterable<[string, RememberedCssSource]>) | undefined;
|
|
28
29
|
isNativeAppStyleTarget: boolean;
|
|
29
30
|
isWebGeneratorTarget: boolean;
|
|
31
|
+
lastCssRawSourceHashByFile: Map<string, string>;
|
|
30
32
|
lastCssResultByFile: Map<string, string>;
|
|
31
33
|
lastCssSourceHashByFile: Map<string, string>;
|
|
32
34
|
markCssAssetProcessed: GenerateBundleContext['markCssAssetProcessed'];
|
|
@@ -4,6 +4,7 @@ export declare function createScopedGeneratorCandidateSignature(rawSource: strin
|
|
|
4
4
|
includeFallbackSignature?: boolean | undefined;
|
|
5
5
|
majorVersion?: number | undefined;
|
|
6
6
|
}): Promise<string>;
|
|
7
|
+
export declare function createScopedGeneratorSourceTraceMap(rawSource: string, sourceFile: string, getSourceCandidateSourcesForEntries: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined): Promise<Map<string, Set<string>> | undefined>;
|
|
7
8
|
export declare function createScopedGeneratorRuntime(options: {
|
|
8
9
|
cssHandlerOptions: {
|
|
9
10
|
isMainChunk?: boolean | undefined;
|
|
@@ -2,5 +2,5 @@ import type { HmrContext, ModuleNode } from 'vite';
|
|
|
2
2
|
export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds: Set<string>): ModuleNode[];
|
|
3
3
|
export declare function resolveHotSourceModules(ctx: HmrContext): ModuleNode[];
|
|
4
4
|
export declare function hasSelfAcceptingNonStyleHotModule(modules: ModuleNode[]): boolean;
|
|
5
|
-
export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[]): void;
|
|
5
|
+
export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[], fallbackCssIds?: Iterable<string>): void;
|
|
6
6
|
export declare function sendFullReloadForUnresolvedHotUpdate(ctx: HmrContext): void;
|
|
@@ -6,10 +6,11 @@ export interface SourceCandidateStore {
|
|
|
6
6
|
syncCss: (id: string, source: string) => Promise<void>;
|
|
7
7
|
merge: (id: string, source: string) => Promise<void>;
|
|
8
8
|
syncFile: (id: string) => Promise<void>;
|
|
9
|
-
|
|
9
|
+
syncCurrentSource: (id: string, source: string) => Promise<SourceCandidateChange>;
|
|
10
|
+
syncCurrentFile: (id: string) => Promise<SourceCandidateChange>;
|
|
10
11
|
scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
|
|
11
12
|
syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
|
|
12
|
-
remove: (id: string) =>
|
|
13
|
+
remove: (id: string) => SourceCandidateChange;
|
|
13
14
|
source: (id: string) => string | undefined;
|
|
14
15
|
sources: () => IterableIterator<[string, string]>;
|
|
15
16
|
values: () => Set<string>;
|
|
@@ -23,6 +24,10 @@ export interface SourceCandidateStore {
|
|
|
23
24
|
}
|
|
24
25
|
export interface SourceCandidateCollector extends SourceCandidateStore {
|
|
25
26
|
}
|
|
27
|
+
export interface SourceCandidateChange {
|
|
28
|
+
addedCandidates: Set<string>;
|
|
29
|
+
removedCandidates: Set<string>;
|
|
30
|
+
}
|
|
26
31
|
export interface SourceCandidateCollectorSnapshot {
|
|
27
32
|
candidatesById: Array<[string, string[]]>;
|
|
28
33
|
cssCandidatesById?: Array<[string, string[]]> | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from './shared/framework-strategy';
|
|
2
|
+
export declare function shouldApplyViteWebCssCompat(context: ViteFrameworkCssPipelineContext, strategy: ViteFrameworkCssPipelineStrategy | undefined): boolean;
|
|
3
|
+
export declare function resolveViteWebCssCompatOptions(context: ViteFrameworkCssPipelineContext): import("@weapp-tailwindcss/postcss").WebCssCompatUserOptions | undefined;
|
|
@@ -10,7 +10,15 @@ export declare function createWebpackCssSourceResolvers(options: {
|
|
|
10
10
|
hasRuntime?: () => boolean;
|
|
11
11
|
name?: string | undefined;
|
|
12
12
|
}>;
|
|
13
|
+
getAsset?: ((file: string) => {
|
|
14
|
+
source?: {
|
|
15
|
+
source?: (() => string | {
|
|
16
|
+
toString: () => string;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
} | undefined) | undefined;
|
|
13
20
|
};
|
|
21
|
+
cssAssetFiles: Iterable<string>;
|
|
14
22
|
cssAssetResources: ReadonlyMap<string, ReadonlySet<string>>;
|
|
15
23
|
cssHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>;
|
|
16
24
|
cssSources: Map<string, {
|
|
@@ -25,6 +33,7 @@ export declare function createWebpackCssSourceResolvers(options: {
|
|
|
25
33
|
runtimeState: SetupWebpackV5ProcessAssetsHookOptions['runtimeState'];
|
|
26
34
|
}): {
|
|
27
35
|
activeWebpackCssSourceFiles: Set<string>;
|
|
36
|
+
configuredCssEntryFiles: string[];
|
|
28
37
|
configuredMainCssEntryFiles: string[];
|
|
29
38
|
getCssHandlerOptions: (file: string, rawSource?: string | undefined) => WebpackCssHandlerOptions;
|
|
30
39
|
getCssUserHandlerOptions: (file: string) => WebpackCssHandlerOptions;
|
|
@@ -191,12 +191,15 @@ export declare function createWebpackCurrentAssetUserRawSource(options: {
|
|
|
191
191
|
export declare function finalizeTracedWebpackCssAsset(css: string, cssHandlerOptions: WebpackCssHandlerOptions, options: {
|
|
192
192
|
annotateCss: (css: string) => string;
|
|
193
193
|
compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'];
|
|
194
|
+
finalized?: boolean | undefined;
|
|
194
195
|
isWebGeneratorTarget: boolean;
|
|
195
196
|
}): string;
|
|
196
197
|
export declare function finalizeWebpackCssAssetSource(source: string, compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], isWebGeneratorTarget: boolean, options?: {
|
|
197
198
|
cssPreflight?: boolean | undefined;
|
|
198
199
|
generatedCss?: boolean;
|
|
200
|
+
preserveExistingPreflight?: boolean | undefined;
|
|
199
201
|
}): string;
|
|
202
|
+
export declare function finalizeWebpackCssAssetOutputSource(source: string, compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], isWebGeneratorTarget: boolean): string;
|
|
200
203
|
export declare function collectWebpackJsRuntimeCandidatesFromAssets(options: {
|
|
201
204
|
escapeFragments: ReturnType<typeof createEscapeFragments>;
|
|
202
205
|
getAssetSource: (file: string) => WebpackSourceLike | undefined;
|
package/dist/cli.js
CHANGED
|
@@ -38,8 +38,8 @@ let debug = require("debug");
|
|
|
38
38
|
debug = __toESM(debug);
|
|
39
39
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
40
40
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
41
|
-
require("micromatch");
|
|
42
41
|
let node_module = require("node:module");
|
|
42
|
+
require("micromatch");
|
|
43
43
|
require("fast-glob");
|
|
44
44
|
require("tailwindcss-config");
|
|
45
45
|
let _babel_traverse = require("@babel/traverse");
|
|
@@ -75,6 +75,7 @@ function definedEntries(value) {
|
|
|
75
75
|
function omitUndefined(value) {
|
|
76
76
|
return Object.fromEntries(definedEntries(value));
|
|
77
77
|
}
|
|
78
|
+
(0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
78
79
|
//#endregion
|
|
79
80
|
//#region src/tailwindcss/v4-engine/generator/rpx-candidates.ts
|
|
80
81
|
const RPX_LENGTH_UTILITY_PATTERN = String.raw`text|border(?:-[trblxyse])?|bg|outline|ring`;
|
|
@@ -360,8 +361,8 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
360
361
|
* 返回结构化结果,附带已计算的 escapedValue 以避免下游重复 escape。
|
|
361
362
|
*/
|
|
362
363
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
363
|
-
if (alwaysEscape) return DIRECT_RESULT;
|
|
364
364
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
365
|
+
if (alwaysEscape) return DIRECT_RESULT;
|
|
365
366
|
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
366
367
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
367
368
|
if (classNameSet && classNameSet.size > 0) {
|
package/dist/cli.mjs
CHANGED
|
@@ -46,6 +46,7 @@ function definedEntries(value) {
|
|
|
46
46
|
function omitUndefined(value) {
|
|
47
47
|
return Object.fromEntries(definedEntries(value));
|
|
48
48
|
}
|
|
49
|
+
createRequire(import.meta.url);
|
|
49
50
|
//#endregion
|
|
50
51
|
//#region src/tailwindcss/v4-engine/generator/rpx-candidates.ts
|
|
51
52
|
const RPX_LENGTH_UTILITY_PATTERN = String.raw`text|border(?:-[trblxyse])?|bg|outline|ring`;
|
|
@@ -331,8 +332,8 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
331
332
|
* 返回结构化结果,附带已计算的 escapedValue 以避免下游重复 escape。
|
|
332
333
|
*/
|
|
333
334
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
334
|
-
if (alwaysEscape) return DIRECT_RESULT;
|
|
335
335
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
336
|
+
if (alwaysEscape) return DIRECT_RESULT;
|
|
336
337
|
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
337
338
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
338
339
|
if (classNameSet && classNameSet.size > 0) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { resolveMpxPlatform } from "./framework.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { a as resolveGeneratorRuntimeBranch, i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-DugIHBgl.mjs";
|
|
2
|
+
import { D as resolveBooleanObjectOption, Ft as loadTailwindV4DesignSystem, It as resolveValidTailwindV4Candidates$1, Mt as resolveCssMacroTailwindV4Source, Pt as omitUndefined, a as resolveGeneratorRuntimeBranch, gt as createTailwindV4Engine$1, i as normalizeWeappTailwindcssGeneratorOptions, u as resolveTailwindV4SourceFromRuntime } from "./generator-ROzBodj6.mjs";
|
|
4
3
|
import { i as isMap, n as defuOverrideArray } from "./utils-DodxWHGz.mjs";
|
|
5
4
|
import { a as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, i as resolveDefaultCssPreflight, o as HARD_PARSE_CACHE_MAX_ENTRIES, r as getDefaultOptions } from "./defaults-9B6aMyZb.mjs";
|
|
6
|
-
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-
|
|
5
|
+
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-hzy_WaC9.mjs";
|
|
7
6
|
import { createRequire } from "node:module";
|
|
8
7
|
import path from "node:path";
|
|
9
8
|
import process from "node:process";
|
|
@@ -826,8 +825,8 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
826
825
|
* 返回结构化结果,附带已计算的 escapedValue 以避免下游重复 escape。
|
|
827
826
|
*/
|
|
828
827
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
829
|
-
if (alwaysEscape) return DIRECT_RESULT;
|
|
830
828
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
829
|
+
if (alwaysEscape) return DIRECT_RESULT;
|
|
831
830
|
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
832
831
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
833
832
|
if (classNameSet && classNameSet.size > 0) {
|
|
@@ -4865,6 +4864,7 @@ function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
|
4865
4864
|
};
|
|
4866
4865
|
return {
|
|
4867
4866
|
appType: ctx.appType,
|
|
4867
|
+
postcssOptions: ctx.postcssOptions,
|
|
4868
4868
|
cssPreflight: cssOptions.cssPreflight,
|
|
4869
4869
|
cssPreflightRange: cssOptions.cssPreflightRange,
|
|
4870
4870
|
cssChildCombinatorReplaceValue: cssOptions.cssChildCombinatorReplaceValue,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
-
const
|
|
4
|
-
const require_generator = require("./generator-DaaFxR5V.js");
|
|
3
|
+
const require_generator = require("./generator-Bz94KTkH.js");
|
|
5
4
|
require("./utils-D3h8j7Mk.js");
|
|
6
5
|
const require_defaults = require("./defaults-nsf4VNMX.js");
|
|
7
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-Dn5DVlkI.js");
|
|
8
7
|
let node_path = require("node:path");
|
|
9
8
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
10
9
|
let node_process = require("node:process");
|
|
@@ -12,8 +11,8 @@ node_process = require_rolldown_runtime.__toESM(node_process);
|
|
|
12
11
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
13
12
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
14
13
|
let lru_cache = require("lru-cache");
|
|
15
|
-
let node_fs_promises = require("node:fs/promises");
|
|
16
14
|
let node_module = require("node:module");
|
|
15
|
+
let node_fs_promises = require("node:fs/promises");
|
|
17
16
|
let node_buffer = require("node:buffer");
|
|
18
17
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
19
18
|
let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
|
|
@@ -258,8 +257,8 @@ function tryGetRuntimeClassSetSync(tailwindRuntime) {
|
|
|
258
257
|
async function collectTailwindV4GeneratorClassSet(tailwindRuntime) {
|
|
259
258
|
if (typeof tailwindRuntime.collectContentTokens !== "function") return;
|
|
260
259
|
try {
|
|
261
|
-
const source =
|
|
262
|
-
const generated = await
|
|
260
|
+
const source = require_generator.resolveCssMacroTailwindV4Source(await require_generator.resolveTailwindV4SourceFromRuntime(tailwindRuntime));
|
|
261
|
+
const generated = await require_generator.createTailwindV4Engine(source).generate({
|
|
263
262
|
scanSources: true,
|
|
264
263
|
target: "web"
|
|
265
264
|
});
|
|
@@ -397,7 +396,7 @@ function logTailwindcssTarget(tailwindRuntime, baseDir) {
|
|
|
397
396
|
//#endregion
|
|
398
397
|
//#region src/unocss/index.ts
|
|
399
398
|
function normalizeUnocssOptions(unocss) {
|
|
400
|
-
return
|
|
399
|
+
return require_generator.resolveBooleanObjectOption(unocss, {});
|
|
401
400
|
}
|
|
402
401
|
function resolveUnocssBareArbitraryValues(arbitraryValues, unocss) {
|
|
403
402
|
const baseArbitraryValues = arbitraryValues ?? {};
|
|
@@ -759,7 +758,7 @@ function replaceWxml(original, options = {
|
|
|
759
758
|
const { keepEOL, escapeMap, ignoreHead } = options;
|
|
760
759
|
let res = original;
|
|
761
760
|
if (!keepEOL) res = res.replaceAll(NEWLINE_RE, "");
|
|
762
|
-
res = (0, _weapp_core_escape.escape)(res,
|
|
761
|
+
res = (0, _weapp_core_escape.escape)(res, require_generator.omitUndefined({
|
|
763
762
|
map: escapeMap,
|
|
764
763
|
ignoreHead
|
|
765
764
|
}));
|
|
@@ -834,8 +833,8 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
834
833
|
* 返回结构化结果,附带已计算的 escapedValue 以避免下游重复 escape。
|
|
835
834
|
*/
|
|
836
835
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
837
|
-
if (alwaysEscape) return DIRECT_RESULT;
|
|
838
836
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
837
|
+
if (alwaysEscape) return DIRECT_RESULT;
|
|
839
838
|
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
840
839
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
841
840
|
if (classNameSet && classNameSet.size > 0) {
|
|
@@ -4824,7 +4823,7 @@ const DEFAULT_RUNTIME_PACKAGE_REPLACEMENTS = {
|
|
|
4824
4823
|
//#endregion
|
|
4825
4824
|
//#region src/context/runtime-package-replacements.ts
|
|
4826
4825
|
function resolveRuntimePackageReplacements(option) {
|
|
4827
|
-
const mapping =
|
|
4826
|
+
const mapping = require_generator.resolveBooleanObjectOption(option, DEFAULT_RUNTIME_PACKAGE_REPLACEMENTS);
|
|
4828
4827
|
if (!mapping) return;
|
|
4829
4828
|
const normalized = {};
|
|
4830
4829
|
for (const [from, to] of Object.entries(mapping)) {
|
|
@@ -4873,6 +4872,7 @@ function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
|
4873
4872
|
};
|
|
4874
4873
|
return {
|
|
4875
4874
|
appType: ctx.appType,
|
|
4875
|
+
postcssOptions: ctx.postcssOptions,
|
|
4876
4876
|
cssPreflight: cssOptions.cssPreflight,
|
|
4877
4877
|
cssPreflightRange: cssOptions.cssPreflightRange,
|
|
4878
4878
|
cssChildCombinatorReplaceValue: cssOptions.cssChildCombinatorReplaceValue,
|
package/dist/core.js
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-y2BGCok4.js");
|
|
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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as ensureRuntimeClassSet, l as shouldSkipJsTransform, t as getCompilerContext, y as createTailwindRuntimeReadyPromise } from "./context-
|
|
1
|
+
import { b as ensureRuntimeClassSet, l as shouldSkipJsTransform, t as getCompilerContext, y as createTailwindRuntimeReadyPromise } from "./context-DzkSFEVL.mjs";
|
|
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 });
|
|
@@ -7,16 +7,23 @@ export interface WeappTailwindcssGeneratorOptions {
|
|
|
7
7
|
config?: string | undefined;
|
|
8
8
|
styleOptions?: Partial<IStyleHandlerOptions> | undefined;
|
|
9
9
|
webCompat?: WebCssCompatUserOptions | undefined;
|
|
10
|
+
hmr?: {
|
|
11
|
+
preserveDeletedCss?: boolean | undefined;
|
|
12
|
+
} | undefined;
|
|
10
13
|
importFallback?: boolean | undefined;
|
|
11
14
|
bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
|
|
12
15
|
}
|
|
13
|
-
export type WeappTailwindcssGeneratorUserOptions = WeappTailwindcssGeneratorOptions;
|
|
16
|
+
export type WeappTailwindcssGeneratorUserOptions = WeappTailwindcssGeneratorOptions | false;
|
|
14
17
|
export interface NormalizedWeappTailwindcssGeneratorOptions {
|
|
18
|
+
enabled: boolean;
|
|
15
19
|
target: WeappTailwindcssGeneratorTarget;
|
|
16
20
|
branch: RuntimeBranch;
|
|
17
21
|
config?: string | undefined;
|
|
18
22
|
styleOptions?: Partial<IStyleHandlerOptions> | undefined;
|
|
19
23
|
webCompat: WebCssCompatUserOptions | undefined;
|
|
24
|
+
hmr: {
|
|
25
|
+
preserveDeletedCss: boolean;
|
|
26
|
+
};
|
|
20
27
|
importFallback: boolean;
|
|
21
28
|
bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
|
|
22
29
|
}
|