weapp-tailwindcss 5.1.3 → 5.1.5
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/auto-CrJJc5rK.mjs +13 -0
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +8 -2
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +5 -1
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/tailwind-v4-css-source.d.ts +6 -3
- package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +1 -1
- package/dist/bundlers/vite/hot-css-modules.d.ts +1 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +1 -0
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +2 -1
- package/dist/cli.js +18 -3
- package/dist/cli.mjs +16 -1
- package/dist/{context-D75pwtBW.js → context-BziwyWy1.js} +56 -9
- package/dist/{context-B07Vf584.mjs → context-rrYZuUBU.mjs} +48 -7
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro/auto.d.ts +1 -1
- package/dist/css-macro/index.d.ts +2 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-BhE26nSw.mjs → defaults-9B6aMyZb.mjs} +2 -2
- package/dist/{defaults-DQhgnnn-.js → defaults-nsf4VNMX.js} +2 -2
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/framework/platform.d.ts +2 -0
- package/dist/{generator-DNs6ekoC.mjs → generator-24-HgU9F.mjs} +5 -3
- package/dist/{generator-CV_0irKO.js → generator-CilgHtxb.js} +5 -3
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-B_u8NjQL.js → gulp-CuVsZdO9.js} +7 -6
- package/dist/{gulp-aQMZ0M7c.mjs → gulp-ygWfmOqh.mjs} +4 -4
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DOoHun3i.js → hmr-timing-BKdCeIrn.js} +244 -229
- package/dist/{hmr-timing-DLYQTCDb.mjs → hmr-timing-Dh_nn3w5.mjs} +244 -211
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/js-string-escape.d.ts +1 -0
- package/dist/postcss.js +2 -2
- package/dist/postcss.mjs +2 -2
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-pS87mdHZ.mjs → source-candidate-scan-signature-DATRnS1X.mjs} +165 -8
- package/dist/{source-candidate-scan-signature-DzwebZrf.js → source-candidate-scan-signature-DIj9m4wB.js} +177 -7
- package/dist/style-injector/internal.d.ts +7 -0
- package/dist/style-injector/options.d.ts +25 -0
- package/dist/tailwindcss/v4/preflight.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/css-macro-source.d.ts +2 -0
- package/dist/{tailwindcss-BSCvrs1p.js → tailwindcss-BwoNQ3t8.js} +56 -16
- package/dist/{tailwindcss-BwV3_Ryc.mjs → tailwindcss-C-uM4rB8.mjs} +51 -17
- package/dist/{transform-Clj7R818.mjs → transform-DHLemtaX.mjs} +1 -1
- package/dist/{transform-fin-OTVD.js → transform-KLD1tJdb.js} +1 -1
- package/dist/typedoc.export.d.ts +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/user-defined-options/general.d.ts +2 -0
- package/dist/{v4-engine-BklH3CpJ.mjs → v4-engine-BuuYDXt1.mjs} +54 -114
- package/dist/{v4-engine-CKbS27-o.js → v4-engine-CKtsdKxK.js} +57 -111
- package/dist/{vite-CkVMSDDp.js → vite-Yp14HNyS.js} +310 -78
- package/dist/{vite-5Wn0PIzJ.mjs → vite-cH0tTMHc.mjs} +308 -76
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +363 -272
- package/dist/{webpack-DEag6ueE.mjs → webpack-DBhmJ-_P.mjs} +107 -20
- package/dist/{webpack-hvSFaicc.js → webpack-DN3tgLbF.js} +107 -20
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +16 -5
- package/dist/auto-Ba6hDrse.mjs +0 -13
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { hasCssMacroStyleOptions, hasCssMacroTailwindV4CustomVariantConditionalComments, hasCssMacroTailwindV4Source, transformCssMacroCss, transformCssMacroTailwindV4Source, withCssMacroStyleOptions } from "@weapp-tailwindcss/postcss";
|
|
2
|
+
//#region src/css-macro/auto.ts
|
|
3
|
+
const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
|
|
4
|
+
function markCssMacroPlugin(value) {
|
|
5
|
+
Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
|
|
6
|
+
configurable: false,
|
|
7
|
+
enumerable: false,
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { transformCssMacroCss as a, markCssMacroPlugin as i, hasCssMacroTailwindV4CustomVariantConditionalComments as n, transformCssMacroTailwindV4Source as o, hasCssMacroTailwindV4Source as r, withCssMacroStyleOptions as s, hasCssMacroStyleOptions as t };
|
|
@@ -6,13 +6,19 @@ import type { InternalUserDefinedOptions } from '../../../types';
|
|
|
6
6
|
export declare function hasMiniProgramTailwindV4PreflightReset(css: string): boolean;
|
|
7
7
|
export declare function finalizeMiniProgramGeneratorCss(css: string, target: string, _majorVersion: number | undefined, cssPreflight: InternalUserDefinedOptions['cssPreflight'], options?: {
|
|
8
8
|
injectPreflight?: boolean;
|
|
9
|
+
preservePreflight?: boolean;
|
|
9
10
|
styleOptions?: Partial<IStyleHandlerOptions> | undefined;
|
|
10
11
|
}): string;
|
|
11
|
-
export declare function
|
|
12
|
+
export declare function resolveMiniProgramPreflightModeForGeneratorCss(opts: InternalUserDefinedOptions, options: {
|
|
12
13
|
cssHandlerOptions: IStyleHandlerOptions;
|
|
13
14
|
isolateCurrentCssCandidates: boolean;
|
|
14
15
|
localImports?: string | undefined;
|
|
15
|
-
|
|
16
|
+
primaryCssSource?: boolean | undefined;
|
|
17
|
+
explicitCssSource?: boolean | undefined;
|
|
18
|
+
}): {
|
|
19
|
+
inject: boolean;
|
|
20
|
+
preserve: boolean;
|
|
21
|
+
};
|
|
16
22
|
export declare function mergeScopedRuntimeWithCurrentRuntime(scopedRuntime: Set<string>, runtime: Set<string>, options: {
|
|
17
23
|
currentCssCandidates?: string[] | undefined;
|
|
18
24
|
cssHandlerOptions: IStyleHandlerOptions;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function cleanLocalCssImportWrapperTailwindDirectives(css: string): string | undefined;
|
|
3
|
-
export declare function splitLocalCssImports(source: string): {
|
|
4
|
-
imports: string;
|
|
5
|
-
source: string;
|
|
6
|
-
} | undefined;
|
|
7
|
-
export declare function restoreLocalCssImports(css: string, imports: string | undefined): string;
|
|
8
|
-
export declare function rewriteLocalCssImportRequestsForOutput(css: string, options?: {
|
|
9
|
-
styleOutputExtension?: string | undefined;
|
|
10
|
-
}): string;
|
|
1
|
+
export { cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, createCssSourceOrderAppend, isLocalCssImportRequest, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, normalizeOutputImportRequest, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, rewriteLocalCssImportRequestsForOutputRoot, splitLocalCssImports, splitLocalCssImportsRoot, } from '@weapp-tailwindcss/postcss';
|
|
@@ -2,8 +2,12 @@ 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
|
+
cssEntryIndex?: number | undefined;
|
|
6
|
+
cssSourceIndex?: number | undefined;
|
|
7
|
+
includesPreflight?: boolean | undefined;
|
|
5
8
|
isolateCssSource?: boolean | undefined;
|
|
6
9
|
matchedCssSourceFile?: string | undefined;
|
|
10
|
+
primaryCssSource?: boolean | undefined;
|
|
7
11
|
sourceEntries?: TailwindSourceEntry[] | undefined;
|
|
8
12
|
sourceBase?: string | undefined;
|
|
9
13
|
sourceCss?: string | undefined;
|
|
@@ -12,4 +16,4 @@ export type GeneratorResolvedSource = TailwindResolvedSource & {
|
|
|
12
16
|
__weappTailwindcssMeta?: GeneratorSourceMetadata | undefined;
|
|
13
17
|
};
|
|
14
18
|
export declare function withGeneratorSourceMetadata(source: TailwindResolvedSource, metadata: GeneratorSourceMetadata): GeneratorResolvedSource;
|
|
15
|
-
export declare function withMatchedSourceSideMetadata(source: TailwindResolvedSource, resolvedEntrySource: SourceSideCssEntrySource): import("@/generator").TailwindV4ResolvedSource;
|
|
19
|
+
export declare function withMatchedSourceSideMetadata(source: TailwindResolvedSource, resolvedEntrySource: SourceSideCssEntrySource, metadata?: GeneratorSourceMetadata): import("@/generator").TailwindV4ResolvedSource;
|
|
@@ -16,6 +16,7 @@ interface CssHandlerOptionsCacheOptions {
|
|
|
16
16
|
getMajorVersion: () => number | undefined;
|
|
17
17
|
getOutputRoot?: (() => string | undefined) | undefined;
|
|
18
18
|
getExtraOptions?: ((file: string) => Partial<IStyleHandlerOptions>) | undefined;
|
|
19
|
+
getDynamicCssOptions?: (() => Partial<IStyleHandlerOptions>) | undefined;
|
|
19
20
|
}
|
|
20
21
|
export interface CssHandlerOptionsCache {
|
|
21
22
|
getCssHandlerOptions: (file: string) => CssHandlerOptions;
|
|
@@ -2,8 +2,11 @@ export interface TailwindV4GenerationCssSourceEntry {
|
|
|
2
2
|
file: string;
|
|
3
3
|
source: string;
|
|
4
4
|
}
|
|
5
|
+
export interface TailwindV4GenerationCssSourceSelectionOptions {
|
|
6
|
+
cwd?: string | undefined;
|
|
7
|
+
outputRoot?: string | undefined;
|
|
8
|
+
projectRoot?: string | undefined;
|
|
9
|
+
}
|
|
5
10
|
export declare function collectTailwindV4SourceFingerprint(source: string): Set<string>;
|
|
6
11
|
export declare function scoreConfiguredTailwindV4SourceForRawSource(rawSource: string | undefined, entrySource: string): number;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function isSameSubpackageScope(outputFile: string, sourceFile: string | undefined, subpackageRoots: Set<string> | undefined): boolean;
|
|
9
|
-
export declare function selectTailwindV4GenerationCssSourceForOutput<T extends TailwindV4GenerationCssSourceEntry>(outputFile: string, entries: T[], rawSource?: string, subpackageRoots?: Set<string> | undefined): T | undefined;
|
|
12
|
+
export declare function selectTailwindV4GenerationCssSourceForOutput<T extends TailwindV4GenerationCssSourceEntry>(outputFile: string, entries: T[], rawSource?: string, options?: TailwindV4GenerationCssSourceSelectionOptions): T | undefined;
|
|
@@ -8,5 +8,5 @@ export declare function isTemporaryCssAssetFile(file: string): boolean;
|
|
|
8
8
|
export declare function createTemporaryCssAssetSourceResolver(entries: TemporaryCssSourceEntry[]): {
|
|
9
9
|
entries: TemporaryCssSourceEntry[];
|
|
10
10
|
markUsed(sourceFile: string | undefined): void;
|
|
11
|
-
resolve(outputFile: string): RememberedCssSource | undefined;
|
|
11
|
+
resolve(outputFile: string, rawSource?: string): RememberedCssSource | undefined;
|
|
12
12
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HmrContext, ModuleNode } from 'vite';
|
|
2
2
|
export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds: Set<string>): ModuleNode[];
|
|
3
|
+
export declare function resolveHotSourceModules(ctx: HmrContext): ModuleNode[];
|
|
3
4
|
export declare function hasSelfAcceptingNonStyleHotModule(modules: ModuleNode[]): boolean;
|
|
4
5
|
export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[]): void;
|
|
5
6
|
export declare function sendFullReloadForUnresolvedHotUpdate(ctx: HmrContext): void;
|
|
@@ -28,6 +28,7 @@ interface CollectViteProcessedCssAssetOptions {
|
|
|
28
28
|
recordViteProcessedCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
29
29
|
resolveViteProcessedCssOutputFile?: ((file: string) => string | undefined) | undefined;
|
|
30
30
|
subpackageRoots?: Set<string> | undefined;
|
|
31
|
+
transformCss?: ((css: string, file: string) => string) | undefined;
|
|
31
32
|
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
32
33
|
}
|
|
33
34
|
interface InjectViteProcessedCssAssetOptions {
|
|
@@ -4,6 +4,7 @@ import type { UserDefinedOptions } from '../../../types';
|
|
|
4
4
|
export interface ResolvedTailwindV4CssEntries {
|
|
5
5
|
entries: TailwindSourceEntry[];
|
|
6
6
|
explicit: boolean;
|
|
7
|
+
includesPreflight: boolean;
|
|
7
8
|
inlineCandidates: TailwindInlineSourceCandidates;
|
|
8
9
|
dependencies: string[];
|
|
9
10
|
}
|
|
@@ -140,7 +140,7 @@ export declare function resolveWebpackMemoryDebugStats(context: {
|
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
142
|
} | undefined;
|
|
143
|
-
export declare function shouldInjectWebpackCssTracePreflight(
|
|
143
|
+
export declare function shouldInjectWebpackCssTracePreflight(_appType: SetupWebpackV5ProcessAssetsHookOptions['appType'], cssHandlerOptions: Pick<WebpackCssHandlerOptions, 'isMainChunk' | 'sourceOptions'>): boolean;
|
|
144
144
|
export declare function finalizeMiniProgramUserCssAssetSource(source: string, compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], isWebGeneratorTarget: boolean, options?: {
|
|
145
145
|
cssPreflight?: boolean | undefined;
|
|
146
146
|
}): string;
|
|
@@ -183,6 +183,7 @@ export declare function finalizeTracedWebpackCssAsset(css: string, cssHandlerOpt
|
|
|
183
183
|
isWebGeneratorTarget: boolean;
|
|
184
184
|
}): string;
|
|
185
185
|
export declare function finalizeWebpackCssAssetSource(source: string, compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], isWebGeneratorTarget: boolean, options?: {
|
|
186
|
+
cssPreflight?: boolean | undefined;
|
|
186
187
|
generatedCss?: boolean;
|
|
187
188
|
}): string;
|
|
188
189
|
export declare function collectWebpackJsRuntimeCandidatesFromAssets(options: {
|
package/dist/cli.js
CHANGED
|
@@ -47,7 +47,6 @@ _babel_traverse = __toESM(_babel_traverse);
|
|
|
47
47
|
let _babel_parser = require("@babel/parser");
|
|
48
48
|
let magic_string = require("magic-string");
|
|
49
49
|
magic_string = __toESM(magic_string);
|
|
50
|
-
let _ast_core_escape = require("@ast-core/escape");
|
|
51
50
|
require("@babel/types");
|
|
52
51
|
//#region src/js/babel/cache-options.ts
|
|
53
52
|
const DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH = 5e4;
|
|
@@ -485,6 +484,22 @@ function isClassContextLiteralPath(path) {
|
|
|
485
484
|
return false;
|
|
486
485
|
}
|
|
487
486
|
//#endregion
|
|
487
|
+
//#region src/js/js-string-escape.ts
|
|
488
|
+
function jsStringEscape(value) {
|
|
489
|
+
return String(value).replaceAll(/[\n\r"'\\\u2028\u2029]/g, (character) => {
|
|
490
|
+
switch (character) {
|
|
491
|
+
case "\"":
|
|
492
|
+
case "'":
|
|
493
|
+
case "\\": return `\\${character}`;
|
|
494
|
+
case "\n": return "\\n";
|
|
495
|
+
case "\r": return "\\r";
|
|
496
|
+
case "\u2028": return "\\u2028";
|
|
497
|
+
case "\u2029": return "\\u2029";
|
|
498
|
+
default: return character;
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
488
503
|
//#region src/js/replacement-cache.ts
|
|
489
504
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
490
505
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
@@ -644,7 +659,7 @@ function replaceHandleValue(path, options) {
|
|
|
644
659
|
return {
|
|
645
660
|
start,
|
|
646
661
|
end,
|
|
647
|
-
value: needEscaped ?
|
|
662
|
+
value: needEscaped ? jsStringEscape(transformed) : transformed,
|
|
648
663
|
path
|
|
649
664
|
};
|
|
650
665
|
}
|
|
@@ -756,7 +771,7 @@ function createEvalReplacementToken(path, updated) {
|
|
|
756
771
|
return {
|
|
757
772
|
start,
|
|
758
773
|
end,
|
|
759
|
-
value: path.isStringLiteral() ?
|
|
774
|
+
value: path.isStringLiteral() ? jsStringEscape(updated) : updated,
|
|
760
775
|
path
|
|
761
776
|
};
|
|
762
777
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -18,7 +18,6 @@ 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 { jsStringEscape } from "@ast-core/escape";
|
|
22
21
|
import "@babel/types";
|
|
23
22
|
//#region src/js/babel/cache-options.ts
|
|
24
23
|
const DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH = 5e4;
|
|
@@ -456,6 +455,22 @@ function isClassContextLiteralPath(path) {
|
|
|
456
455
|
return false;
|
|
457
456
|
}
|
|
458
457
|
//#endregion
|
|
458
|
+
//#region src/js/js-string-escape.ts
|
|
459
|
+
function jsStringEscape(value) {
|
|
460
|
+
return String(value).replaceAll(/[\n\r"'\\\u2028\u2029]/g, (character) => {
|
|
461
|
+
switch (character) {
|
|
462
|
+
case "\"":
|
|
463
|
+
case "'":
|
|
464
|
+
case "\\": return `\\${character}`;
|
|
465
|
+
case "\n": return "\\n";
|
|
466
|
+
case "\r": return "\\r";
|
|
467
|
+
case "\u2028": return "\\u2028";
|
|
468
|
+
case "\u2029": return "\\u2029";
|
|
469
|
+
default: return character;
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
459
474
|
//#region src/js/replacement-cache.ts
|
|
460
475
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
461
476
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_framework = require("./framework.js");
|
|
3
|
+
const require_v4_engine = require("./v4-engine-CKtsdKxK.js");
|
|
4
|
+
const require_generator = require("./generator-CilgHtxb.js");
|
|
4
5
|
require("./utils-D3h8j7Mk.js");
|
|
5
|
-
const require_defaults = require("./defaults-
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
6
|
+
const require_defaults = require("./defaults-nsf4VNMX.js");
|
|
7
|
+
const require_tailwindcss = require("./tailwindcss-BwoNQ3t8.js");
|
|
7
8
|
let node_path = require("node:path");
|
|
8
9
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
9
10
|
let node_process = require("node:process");
|
|
@@ -24,7 +25,6 @@ _babel_traverse = require_rolldown_runtime.__toESM(_babel_traverse);
|
|
|
24
25
|
let _babel_parser = require("@babel/parser");
|
|
25
26
|
let magic_string = require("magic-string");
|
|
26
27
|
magic_string = require_rolldown_runtime.__toESM(magic_string);
|
|
27
|
-
let _ast_core_escape = require("@ast-core/escape");
|
|
28
28
|
let _babel_types = require("@babel/types");
|
|
29
29
|
_babel_types = require_rolldown_runtime.__toESM(_babel_types);
|
|
30
30
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
@@ -121,6 +121,23 @@ function initializeCache(cacheConfig) {
|
|
|
121
121
|
return cacheConfig;
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
|
+
//#region src/framework/platform.ts
|
|
125
|
+
const MPX_TO_UNI_PLATFORM = {
|
|
126
|
+
ali: "mp-alipay",
|
|
127
|
+
dd: "mp-dingtalk",
|
|
128
|
+
jd: "mp-jd",
|
|
129
|
+
qq: "mp-qq",
|
|
130
|
+
swan: "mp-baidu",
|
|
131
|
+
tt: "mp-toutiao",
|
|
132
|
+
wx: "mp-weixin"
|
|
133
|
+
};
|
|
134
|
+
function normalizeFrameworkStylePlatform(platform, appType) {
|
|
135
|
+
const normalized = platform?.trim().toLowerCase();
|
|
136
|
+
if (!normalized) return;
|
|
137
|
+
if (appType === "mpx") return MPX_TO_UNI_PLATFORM[normalized] ?? normalized;
|
|
138
|
+
return normalized;
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
124
141
|
//#region src/debug/index.ts
|
|
125
142
|
const _debug = (0, debug.default)("weapp-tw");
|
|
126
143
|
function createDebug(prefix) {
|
|
@@ -241,7 +258,7 @@ function tryGetRuntimeClassSetSync(tailwindRuntime) {
|
|
|
241
258
|
async function collectTailwindV4GeneratorClassSet(tailwindRuntime) {
|
|
242
259
|
if (typeof tailwindRuntime.collectContentTokens !== "function") return;
|
|
243
260
|
try {
|
|
244
|
-
const source = await require_v4_engine.resolveTailwindV4SourceFromRuntime(tailwindRuntime);
|
|
261
|
+
const source = require_v4_engine.resolveCssMacroTailwindV4Source(await require_v4_engine.resolveTailwindV4SourceFromRuntime(tailwindRuntime));
|
|
245
262
|
const generated = await require_v4_engine.createTailwindV4Engine(source).generate({
|
|
246
263
|
scanSources: true,
|
|
247
264
|
target: "web"
|
|
@@ -941,6 +958,22 @@ function isClassContextLiteralPath(path) {
|
|
|
941
958
|
return false;
|
|
942
959
|
}
|
|
943
960
|
//#endregion
|
|
961
|
+
//#region src/js/js-string-escape.ts
|
|
962
|
+
function jsStringEscape(value) {
|
|
963
|
+
return String(value).replaceAll(/[\n\r"'\\\u2028\u2029]/g, (character) => {
|
|
964
|
+
switch (character) {
|
|
965
|
+
case "\"":
|
|
966
|
+
case "'":
|
|
967
|
+
case "\\": return `\\${character}`;
|
|
968
|
+
case "\n": return "\\n";
|
|
969
|
+
case "\r": return "\\r";
|
|
970
|
+
case "\u2028": return "\\u2028";
|
|
971
|
+
case "\u2029": return "\\u2029";
|
|
972
|
+
default: return character;
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
//#endregion
|
|
944
977
|
//#region src/js/replacement-cache.ts
|
|
945
978
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
946
979
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
@@ -1100,7 +1133,7 @@ function replaceHandleValue(path, options) {
|
|
|
1100
1133
|
return {
|
|
1101
1134
|
start,
|
|
1102
1135
|
end,
|
|
1103
|
-
value: needEscaped ?
|
|
1136
|
+
value: needEscaped ? jsStringEscape(transformed) : transformed,
|
|
1104
1137
|
path
|
|
1105
1138
|
};
|
|
1106
1139
|
}
|
|
@@ -1212,7 +1245,7 @@ function createEvalReplacementToken(path, updated) {
|
|
|
1212
1245
|
return {
|
|
1213
1246
|
start,
|
|
1214
1247
|
end,
|
|
1215
|
-
value: path.isStringLiteral() ?
|
|
1248
|
+
value: path.isStringLiteral() ? jsStringEscape(updated) : updated,
|
|
1216
1249
|
path
|
|
1217
1250
|
};
|
|
1218
1251
|
}
|
|
@@ -2170,7 +2203,7 @@ function addStringLiteralReplacement(rawSource, node, transformOptions, context)
|
|
|
2170
2203
|
const start = node.start + 1;
|
|
2171
2204
|
const end = node.end - 1;
|
|
2172
2205
|
if (start >= end || transformed === rawSource.slice(start, end)) return false;
|
|
2173
|
-
getMagicString(rawSource, context).update(start, end,
|
|
2206
|
+
getMagicString(rawSource, context).update(start, end, jsStringEscape(transformed));
|
|
2174
2207
|
return true;
|
|
2175
2208
|
}
|
|
2176
2209
|
function addTemplateElementReplacement(rawSource, node, transformOptions, context) {
|
|
@@ -4965,6 +4998,13 @@ function syncLegacyFieldsToCssOptions(ctx) {
|
|
|
4965
4998
|
injectAdditionalCssVarScope: ctx.injectAdditionalCssVarScope
|
|
4966
4999
|
};
|
|
4967
5000
|
}
|
|
5001
|
+
function applyFrameworkPlatformDefaults(ctx) {
|
|
5002
|
+
if (ctx.cssOptions?.platform || ctx.platform) {
|
|
5003
|
+
ctx.platform = normalizeFrameworkStylePlatform(ctx.cssOptions?.platform ?? ctx.platform, ctx.appType);
|
|
5004
|
+
return;
|
|
5005
|
+
}
|
|
5006
|
+
if (ctx.appType === "mpx") ctx.platform = normalizeFrameworkStylePlatform(require_framework.resolveMpxPlatform().normalized, ctx.appType);
|
|
5007
|
+
}
|
|
4968
5008
|
async function clearTailwindcssRuntimeCache(tailwindRuntime, options) {
|
|
4969
5009
|
if (!tailwindRuntime) return;
|
|
4970
5010
|
const cacheOptions = tailwindRuntime.options?.cache;
|
|
@@ -4998,6 +5038,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4998
5038
|
ctx.arbitraryValues = resolveUnocssBareArbitraryValues(ctx.arbitraryValues, ctx.unocss);
|
|
4999
5039
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
5000
5040
|
syncCssOptionsToLegacyFields(ctx);
|
|
5041
|
+
applyFrameworkPlatformDefaults(ctx);
|
|
5001
5042
|
applyLoggerLevel(ctx.logLevel);
|
|
5002
5043
|
const tailwindRuntime = require_tailwindcss.createTailwindcssRuntimeFromContext(ctx);
|
|
5003
5044
|
logTailwindcssTarget(tailwindRuntime, ctx.tailwindcssBasedir);
|
|
@@ -5116,6 +5157,12 @@ Object.defineProperty(exports, "isClassContextLiteralPath", {
|
|
|
5116
5157
|
return isClassContextLiteralPath;
|
|
5117
5158
|
}
|
|
5118
5159
|
});
|
|
5160
|
+
Object.defineProperty(exports, "normalizeFrameworkStylePlatform", {
|
|
5161
|
+
enumerable: true,
|
|
5162
|
+
get: function() {
|
|
5163
|
+
return normalizeFrameworkStylePlatform;
|
|
5164
|
+
}
|
|
5165
|
+
});
|
|
5119
5166
|
Object.defineProperty(exports, "normalizeStyleHandlerMajorVersion", {
|
|
5120
5167
|
enumerable: true,
|
|
5121
5168
|
get: function() {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { resolveMpxPlatform } from "./framework.mjs";
|
|
2
|
+
import { W as createTailwindV4Engine$1, ct as omitUndefined, dt as resolveValidTailwindV4Candidates$1, n as resolveTailwindV4SourceFromRuntime, ot as resolveCssMacroTailwindV4Source, ut as loadTailwindV4DesignSystem, y as resolveBooleanObjectOption } from "./v4-engine-BuuYDXt1.mjs";
|
|
3
|
+
import { a as resolveGeneratorRuntimeBranch, i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-24-HgU9F.mjs";
|
|
3
4
|
import { i as isMap, n as defuOverrideArray } from "./utils-DodxWHGz.mjs";
|
|
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-
|
|
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-
|
|
5
|
+
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-C-uM4rB8.mjs";
|
|
6
7
|
import { createRequire } from "node:module";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import process from "node:process";
|
|
@@ -18,7 +19,6 @@ import _createDebug from "debug";
|
|
|
18
19
|
import _babelTraverse from "@babel/traverse";
|
|
19
20
|
import { parse, parseExpression } from "@babel/parser";
|
|
20
21
|
import MagicString from "magic-string";
|
|
21
|
-
import { jsStringEscape } from "@ast-core/escape";
|
|
22
22
|
import * as t from "@babel/types";
|
|
23
23
|
//#region src/cache/index.ts
|
|
24
24
|
function isProcessResult(value) {
|
|
@@ -113,6 +113,23 @@ function initializeCache(cacheConfig) {
|
|
|
113
113
|
return cacheConfig;
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
|
+
//#region src/framework/platform.ts
|
|
117
|
+
const MPX_TO_UNI_PLATFORM = {
|
|
118
|
+
ali: "mp-alipay",
|
|
119
|
+
dd: "mp-dingtalk",
|
|
120
|
+
jd: "mp-jd",
|
|
121
|
+
qq: "mp-qq",
|
|
122
|
+
swan: "mp-baidu",
|
|
123
|
+
tt: "mp-toutiao",
|
|
124
|
+
wx: "mp-weixin"
|
|
125
|
+
};
|
|
126
|
+
function normalizeFrameworkStylePlatform(platform, appType) {
|
|
127
|
+
const normalized = platform?.trim().toLowerCase();
|
|
128
|
+
if (!normalized) return;
|
|
129
|
+
if (appType === "mpx") return MPX_TO_UNI_PLATFORM[normalized] ?? normalized;
|
|
130
|
+
return normalized;
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
116
133
|
//#region src/debug/index.ts
|
|
117
134
|
const _debug = _createDebug("weapp-tw");
|
|
118
135
|
function createDebug(prefix) {
|
|
@@ -233,7 +250,7 @@ function tryGetRuntimeClassSetSync(tailwindRuntime) {
|
|
|
233
250
|
async function collectTailwindV4GeneratorClassSet(tailwindRuntime) {
|
|
234
251
|
if (typeof tailwindRuntime.collectContentTokens !== "function") return;
|
|
235
252
|
try {
|
|
236
|
-
const source = await resolveTailwindV4SourceFromRuntime(tailwindRuntime);
|
|
253
|
+
const source = resolveCssMacroTailwindV4Source(await resolveTailwindV4SourceFromRuntime(tailwindRuntime));
|
|
237
254
|
const generated = await createTailwindV4Engine$1(source).generate({
|
|
238
255
|
scanSources: true,
|
|
239
256
|
target: "web"
|
|
@@ -933,6 +950,22 @@ function isClassContextLiteralPath(path) {
|
|
|
933
950
|
return false;
|
|
934
951
|
}
|
|
935
952
|
//#endregion
|
|
953
|
+
//#region src/js/js-string-escape.ts
|
|
954
|
+
function jsStringEscape(value) {
|
|
955
|
+
return String(value).replaceAll(/[\n\r"'\\\u2028\u2029]/g, (character) => {
|
|
956
|
+
switch (character) {
|
|
957
|
+
case "\"":
|
|
958
|
+
case "'":
|
|
959
|
+
case "\\": return `\\${character}`;
|
|
960
|
+
case "\n": return "\\n";
|
|
961
|
+
case "\r": return "\\r";
|
|
962
|
+
case "\u2028": return "\\u2028";
|
|
963
|
+
case "\u2029": return "\\u2029";
|
|
964
|
+
default: return character;
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
936
969
|
//#region src/js/replacement-cache.ts
|
|
937
970
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
938
971
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
@@ -4957,6 +4990,13 @@ function syncLegacyFieldsToCssOptions(ctx) {
|
|
|
4957
4990
|
injectAdditionalCssVarScope: ctx.injectAdditionalCssVarScope
|
|
4958
4991
|
};
|
|
4959
4992
|
}
|
|
4993
|
+
function applyFrameworkPlatformDefaults(ctx) {
|
|
4994
|
+
if (ctx.cssOptions?.platform || ctx.platform) {
|
|
4995
|
+
ctx.platform = normalizeFrameworkStylePlatform(ctx.cssOptions?.platform ?? ctx.platform, ctx.appType);
|
|
4996
|
+
return;
|
|
4997
|
+
}
|
|
4998
|
+
if (ctx.appType === "mpx") ctx.platform = normalizeFrameworkStylePlatform(resolveMpxPlatform().normalized, ctx.appType);
|
|
4999
|
+
}
|
|
4960
5000
|
async function clearTailwindcssRuntimeCache(tailwindRuntime, options) {
|
|
4961
5001
|
if (!tailwindRuntime) return;
|
|
4962
5002
|
const cacheOptions = tailwindRuntime.options?.cache;
|
|
@@ -4990,6 +5030,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4990
5030
|
ctx.arbitraryValues = resolveUnocssBareArbitraryValues(ctx.arbitraryValues, ctx.unocss);
|
|
4991
5031
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
4992
5032
|
syncCssOptionsToLegacyFields(ctx);
|
|
5033
|
+
applyFrameworkPlatformDefaults(ctx);
|
|
4993
5034
|
applyLoggerLevel(ctx.logLevel);
|
|
4994
5035
|
const tailwindRuntime = createTailwindcssRuntimeFromContext(ctx);
|
|
4995
5036
|
logTailwindcssTarget(tailwindRuntime, ctx.tailwindcssBasedir);
|
|
@@ -5030,4 +5071,4 @@ function getCompilerContext(opts) {
|
|
|
5030
5071
|
return withCompilerContextCache(opts, () => createInternalCompilerContext(opts));
|
|
5031
5072
|
}
|
|
5032
5073
|
//#endregion
|
|
5033
|
-
export {
|
|
5074
|
+
export { normalizeFrameworkStylePlatform as C, createDebug as S, toCustomAttributesEntities as _, vitePluginName as a, ensureRuntimeClassSet as b, createAttributeMatcher as c, JsTokenUpdater as d, _defineProperty as f, traverse as g, babelParse as h, pluginName as i, shouldSkipJsTransform as l, replaceWxml as m, normalizeStyleHandlerMajorVersion as n, Parser as o, isClassContextLiteralPath as p, resolveStyleOptionsFromContext as r, generateCode as s, getCompilerContext as t, analyzeSource as u, collectRuntimeClassSet as v, md5Hash as w, refreshTailwindRuntimeState as x, createTailwindRuntimeReadyPromise as y };
|
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-BziwyWy1.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-rrYZuUBU.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 });
|
package/dist/css-macro/auto.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { compileCssMacroConditionalComments, CSS_MACRO_STYLE_OPTIONS_MARKER, hasCssMacroStyleOptions, hasCssMacroTailwindV4Directive, transformCssMacroCss, withCssMacroStyleOptions, } from '@weapp-tailwindcss/postcss';
|
|
1
|
+
export { compileCssMacroConditionalComments, CSS_MACRO_STYLE_OPTIONS_MARKER, hasCssMacroStyleOptions, hasCssMacroTailwindV4CustomVariantConditionalComments, hasCssMacroTailwindV4Directive, hasCssMacroTailwindV4InternalAtRules, hasCssMacroTailwindV4Source, transformCssMacroCss, transformCssMacroTailwindV4Source, withCssMacroStyleOptions, } from '@weapp-tailwindcss/postcss';
|
|
2
2
|
export declare const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
|
|
3
3
|
export declare function markCssMacroPlugin<T extends object>(value: T): T;
|
|
4
4
|
export declare function isCssMacroTailwindPlugin(value: unknown): boolean;
|
package/dist/css-macro.mjs
CHANGED
|
@@ -10,10 +10,10 @@ const HTML_FILE_PATTERN = /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/;
|
|
|
10
10
|
const JS_FILE_PATTERN = /.+\.[cm]?js?$/;
|
|
11
11
|
const alwaysFalse = () => false;
|
|
12
12
|
const TAILWIND_V4_CSS_PREFLIGHT = {
|
|
13
|
+
"border": "0 solid",
|
|
13
14
|
"box-sizing": "border-box",
|
|
14
15
|
"margin": "0",
|
|
15
|
-
"padding": "0"
|
|
16
|
-
"border": "0 solid"
|
|
16
|
+
"padding": "0"
|
|
17
17
|
};
|
|
18
18
|
function getDefaultCssPreflight() {
|
|
19
19
|
return { ...TAILWIND_V4_CSS_PREFLIGHT };
|
|
@@ -11,10 +11,10 @@ const HTML_FILE_PATTERN = /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/;
|
|
|
11
11
|
const JS_FILE_PATTERN = /.+\.[cm]?js?$/;
|
|
12
12
|
const alwaysFalse = () => false;
|
|
13
13
|
const TAILWIND_V4_CSS_PREFLIGHT = {
|
|
14
|
+
"border": "0 solid",
|
|
14
15
|
"box-sizing": "border-box",
|
|
15
16
|
"margin": "0",
|
|
16
|
-
"padding": "0"
|
|
17
|
-
"border": "0 solid"
|
|
17
|
+
"padding": "0"
|
|
18
18
|
};
|
|
19
19
|
function getDefaultCssPreflight() {
|
|
20
20
|
return { ...TAILWIND_V4_CSS_PREFLIGHT };
|
package/dist/defaults.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CssPreflightOptions, UserDefinedOptions } from './types';
|
|
2
2
|
export declare const TAILWIND_V4_CSS_PREFLIGHT: {
|
|
3
|
+
border: string;
|
|
3
4
|
'box-sizing': string;
|
|
4
5
|
margin: string;
|
|
5
6
|
padding: string;
|
|
6
|
-
border: string;
|
|
7
7
|
};
|
|
8
8
|
export declare function getDefaultCssPreflight(): Exclude<CssPreflightOptions, false>;
|
|
9
9
|
export declare function resolveDefaultCssPreflight(cssPreflight: CssPreflightOptions | undefined, _tailwindcssMajorVersion?: number): CssPreflightOptions;
|
package/dist/defaults.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_defaults = require("./defaults-
|
|
2
|
+
const require_defaults = require("./defaults-nsf4VNMX.js");
|
|
3
3
|
exports.TAILWIND_V4_CSS_PREFLIGHT = require_defaults.TAILWIND_V4_CSS_PREFLIGHT;
|
|
4
4
|
exports.getDefaultCssPreflight = require_defaults.getDefaultCssPreflight;
|
|
5
5
|
exports.getDefaultOptions = require_defaults.getDefaultOptions;
|
package/dist/defaults.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as resolveDefaultCssPreflight, n as getDefaultCssPreflight, r as getDefaultOptions, t as TAILWIND_V4_CSS_PREFLIGHT } from "./defaults-
|
|
1
|
+
import { i as resolveDefaultCssPreflight, n as getDefaultCssPreflight, r as getDefaultOptions, t as TAILWIND_V4_CSS_PREFLIGHT } from "./defaults-9B6aMyZb.mjs";
|
|
2
2
|
export { TAILWIND_V4_CSS_PREFLIGHT, getDefaultCssPreflight, getDefaultOptions, resolveDefaultCssPreflight };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as createTailwindV4Engine,
|
|
1
|
+
import { W as createTailwindV4Engine, lt as inferGeneratorTargetFromEnv, n as resolveTailwindV4SourceFromRuntime } from "./v4-engine-BuuYDXt1.mjs";
|
|
2
2
|
import { o as resolveUniUtsPlatform } from "./utils-DodxWHGz.mjs";
|
|
3
3
|
//#region src/runtime-branch/create-branch.ts
|
|
4
4
|
function createRuntimeBranch(base, platformFamily, options) {
|
|
@@ -93,10 +93,12 @@ function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
|
93
93
|
...context,
|
|
94
94
|
generatorTarget: target
|
|
95
95
|
});
|
|
96
|
+
const hasExplicitTarget = options !== void 0 && Object.hasOwn(options, "target");
|
|
97
|
+
const webCompat = options?.webCompat ?? (!hasExplicitTarget && branch.isWeb ? true : void 0);
|
|
96
98
|
if (options == null) return {
|
|
97
99
|
target,
|
|
98
100
|
branch,
|
|
99
|
-
webCompat
|
|
101
|
+
webCompat,
|
|
100
102
|
importFallback: false,
|
|
101
103
|
bareArbitraryValues: void 0
|
|
102
104
|
};
|
|
@@ -105,7 +107,7 @@ function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
|
105
107
|
branch,
|
|
106
108
|
config: options.config,
|
|
107
109
|
styleOptions: options.styleOptions,
|
|
108
|
-
webCompat
|
|
110
|
+
webCompat,
|
|
109
111
|
importFallback: options.importFallback ?? false,
|
|
110
112
|
bareArbitraryValues: options.bareArbitraryValues
|
|
111
113
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_v4_engine = require("./v4-engine-
|
|
1
|
+
const require_v4_engine = require("./v4-engine-CKtsdKxK.js");
|
|
2
2
|
const require_utils = require("./utils-D3h8j7Mk.js");
|
|
3
3
|
//#region src/runtime-branch/create-branch.ts
|
|
4
4
|
function createRuntimeBranch(base, platformFamily, options) {
|
|
@@ -93,10 +93,12 @@ function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
|
93
93
|
...context,
|
|
94
94
|
generatorTarget: target
|
|
95
95
|
});
|
|
96
|
+
const hasExplicitTarget = options !== void 0 && Object.hasOwn(options, "target");
|
|
97
|
+
const webCompat = options?.webCompat ?? (!hasExplicitTarget && branch.isWeb ? true : void 0);
|
|
96
98
|
if (options == null) return {
|
|
97
99
|
target,
|
|
98
100
|
branch,
|
|
99
|
-
webCompat
|
|
101
|
+
webCompat,
|
|
100
102
|
importFallback: false,
|
|
101
103
|
bareArbitraryValues: void 0
|
|
102
104
|
};
|
|
@@ -105,7 +107,7 @@ function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
|
105
107
|
branch,
|
|
106
108
|
config: options.config,
|
|
107
109
|
styleOptions: options.styleOptions,
|
|
108
|
-
webCompat
|
|
110
|
+
webCompat,
|
|
109
111
|
importFallback: options.importFallback ?? false,
|
|
110
112
|
bareArbitraryValues: options.bareArbitraryValues
|
|
111
113
|
};
|
package/dist/generator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_v4_engine = require("./v4-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_v4_engine = require("./v4-engine-CKtsdKxK.js");
|
|
3
|
+
const require_generator = require("./generator-CilgHtxb.js");
|
|
4
4
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
5
5
|
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
|
6
6
|
exports.normalizeWeappTailwindcssGeneratorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions;
|