weapp-tailwindcss 5.1.14 → 5.1.16
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-2dg_uhEJ.mjs +13 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +2 -0
- package/dist/bundlers/gulp/index.d.ts +2 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/cache-state.d.ts +71 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +43 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +4 -2
- package/dist/bundlers/shared/framework-postcss.d.ts +14 -0
- package/dist/bundlers/shared/generated-css-marker.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +18 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +25 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +4 -72
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +3 -1
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +14 -0
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +25 -0
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +33 -0
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +16 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +3 -6
- package/dist/bundlers/shared/generator-css/types.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +10 -0
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -33
- package/dist/bundlers/shared/generator-css.d.ts +1 -2
- package/dist/bundlers/shared/style-requests.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +3 -0
- package/dist/bundlers/vite/bundle-state.d.ts +1 -0
- package/dist/bundlers/vite/css-finalizer/options.d.ts +54 -0
- package/dist/bundlers/vite/css-finalizer/plugin.d.ts +3 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -43
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/finalize/bundle.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +69 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +2 -70
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle-runtime.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +12 -0
- package/dist/bundlers/vite/processed-css-assets/collector.d.ts +4 -0
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +34 -0
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +42 -0
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +89 -0
- package/dist/bundlers/vite/processed-css-assets/style-files.d.ts +3 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +4 -71
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +4 -2
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +2 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +5 -4
- package/dist/bundlers/vite/source-candidates/collector.d.ts +8 -0
- package/dist/bundlers/vite/source-candidates/store.d.ts +2 -0
- package/dist/bundlers/vite/source-candidates/types-and-cache.d.ts +69 -0
- package/dist/bundlers/vite/source-candidates.d.ts +4 -68
- package/dist/bundlers/vite/watch-css-post.d.ts +10 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/finalize-assets.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-result.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-task.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/html-js-tasks.d.ts +5 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +8 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/memory-trace.d.ts +78 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +43 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/resources.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/runtime-candidates.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +21 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +9 -217
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +4 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +4 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +6 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +4 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +3 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +20 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin/watch-output.d.ts +13 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin.d.ts +3 -21
- package/dist/cli.js +14 -18
- package/dist/cli.mjs +14 -18
- package/dist/{context-VeFq_8vW.js → context-BtLIID4m.js} +3 -3
- package/dist/{context-BL8Gy71H.mjs → context-JzwzSX36.mjs} +3 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{generator-CEnUsjed.js → generator-B91GhUJQ.js} +636 -505
- package/dist/{generator-B59OA64h.mjs → generator-Bv7myuhY.mjs} +557 -432
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-DUYWxmZC.mjs → gulp-CKSklPlH.mjs} +218 -153
- package/dist/{gulp-C1Q3LRzg.js → gulp-Q1wITegn.js} +218 -153
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-C3ed5vCx.mjs → hmr-timing-BXg7nI8N.mjs} +3406 -3145
- package/dist/{hmr-timing-BZ5sWIqO.js → hmr-timing-CMPaWn9P.js} +3474 -3147
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/shared/mpx-plugin-owner.d.ts +2 -0
- package/dist/shared/mpx.d.ts +4 -1
- package/dist/{source-candidate-scan-signature-R3dzamcm.js → source-candidate-scan-signature-BKZZk_e6.js} +144 -96
- package/dist/{source-candidate-scan-signature-D7RWjWsY.mjs → source-candidate-scan-signature-CtK-mB_C.mjs} +127 -60
- package/dist/tailwindcss/v4-engine/generator/cache-stats.d.ts +26 -0
- package/dist/tailwindcss/v4-engine/generator/engine.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +52 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -28
- package/dist/{tailwindcss-KBYPJ2DW.js → tailwindcss-B4phC0kB.js} +2 -2
- package/dist/{tailwindcss-DPcKMLxL.mjs → tailwindcss-BTcXX8Ka.mjs} +2 -2
- package/dist/{transform-D5JUgMpE.mjs → transform-B_KM9sLX.mjs} +47 -5
- package/dist/{transform-COFRlmDF.js → transform-CcYptivi.js} +47 -5
- package/dist/uni-app-x/component-local-style.d.ts +1 -0
- package/dist/uni-app-x/style-asset/style-value.d.ts +1 -1
- package/dist/{vite-CBU5NXTX.mjs → vite-BwQWl9ft.mjs} +1269 -878
- package/dist/{vite-BNlPdsGM.js → vite-DhVnXvAQ.js} +1314 -923
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-generation-loader.js +12 -0
- package/dist/weapp-tw-css-import-rewrite-loader-B0tVkJLH.js +10524 -0
- package/dist/weapp-tw-css-import-rewrite-loader.js +6 -10255
- package/dist/weapp-tw-runtime-classset-loader.js +10 -4
- package/dist/{webpack-CZ38fMGC.mjs → webpack-Bo1QrFPf.mjs} +1518 -1079
- package/dist/{webpack-Jpe048pQ.js → webpack-kh78iMSS.js} +1519 -1080
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +17 -7
- package/dist/auto-CrJJc5rK.mjs +0 -13
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { OutputAsset, OutputBundle } from 'rollup';
|
|
2
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../shared/framework-strategy';
|
|
3
|
+
import type { InternalUserDefinedOptions } from '../../../types';
|
|
4
|
+
export { isCssOutputFile } from './style-files';
|
|
5
|
+
export interface CssAssetMarkerMatcher {
|
|
6
|
+
(asset: OutputAsset, file?: string): boolean;
|
|
7
|
+
}
|
|
8
|
+
interface CssAssetProcessedMarker {
|
|
9
|
+
(asset: OutputAsset, file?: string): void;
|
|
10
|
+
}
|
|
11
|
+
interface CssAssetResultRecordOptions {
|
|
12
|
+
injectIntoMain?: boolean | undefined;
|
|
13
|
+
outputFile?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface CssAssetResultRecorder {
|
|
16
|
+
(file: string, css: string, options?: CssAssetResultRecordOptions): void;
|
|
17
|
+
}
|
|
18
|
+
interface CssAssetResultsGetter {
|
|
19
|
+
(): Iterable<[string, string | {
|
|
20
|
+
css: string;
|
|
21
|
+
injectIntoMain?: boolean | undefined;
|
|
22
|
+
outputFile?: string | undefined;
|
|
23
|
+
}]>;
|
|
24
|
+
}
|
|
25
|
+
export interface CollectViteProcessedCssAssetOptions {
|
|
26
|
+
opts?: InternalUserDefinedOptions | undefined;
|
|
27
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
28
|
+
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
29
|
+
isViteProcessedCssAsset?: CssAssetMarkerMatcher | undefined;
|
|
30
|
+
markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
|
|
31
|
+
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
32
|
+
recordViteProcessedCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
33
|
+
resolveViteProcessedCssOutputFile?: ((file: string) => string | undefined) | undefined;
|
|
34
|
+
subpackageRoots?: Set<string> | undefined;
|
|
35
|
+
transformCss?: ((css: string, file: string) => string) | undefined;
|
|
36
|
+
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface InjectViteProcessedCssAssetOptions {
|
|
39
|
+
opts: InternalUserDefinedOptions;
|
|
40
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
41
|
+
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
42
|
+
getViteProcessedCssAssetResults?: CssAssetResultsGetter | undefined;
|
|
43
|
+
markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
|
|
44
|
+
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
45
|
+
shouldRemoveInjectedSourceAsset?: ((file: string, record: {
|
|
46
|
+
file: string;
|
|
47
|
+
css: string;
|
|
48
|
+
injectIntoMain?: boolean | undefined;
|
|
49
|
+
outputFile?: string | undefined;
|
|
50
|
+
}) => boolean) | undefined;
|
|
51
|
+
transformCss?: ((css: string, file: string) => string) | undefined;
|
|
52
|
+
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
53
|
+
onUpdate?: ((file: string, original: string, generated: string) => void) | undefined;
|
|
54
|
+
recordTimingDetail?: ((name: string, startedAt: number) => void) | undefined;
|
|
55
|
+
}
|
|
56
|
+
export declare function createCssAssetPipelineContext(options: Pick<CollectViteProcessedCssAssetOptions & InjectViteProcessedCssAssetOptions, 'createCssPipelineContext'>, file: string, bundle: OutputBundle): {
|
|
57
|
+
bundle: OutputBundle;
|
|
58
|
+
currentGeneratorBranch: ReturnType<typeof import("../../../runtime-branch").resolveGeneratorRuntimeBranch>;
|
|
59
|
+
currentGeneratorOptions: ReturnType<typeof import("../../..").normalizeWeappTailwindcssGeneratorOptions>;
|
|
60
|
+
opts: InternalUserDefinedOptions;
|
|
61
|
+
resolvedConfig: import("vite").ResolvedConfig | undefined;
|
|
62
|
+
resolveStylePlatform: () => string | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
export declare function getAssetFile(bundleFile: string, asset: OutputAsset): string;
|
|
65
|
+
export declare function readAssetSource(asset: OutputAsset): string;
|
|
66
|
+
export declare function clearAssetSource(asset: OutputAsset): void;
|
|
67
|
+
export declare function appendCss(baseCss: string, css: string): string;
|
|
68
|
+
export declare function hasNonCommentCss(css: string): boolean;
|
|
69
|
+
export declare function dedupeViteCssResults<T extends {
|
|
70
|
+
css: string;
|
|
71
|
+
outputFile?: string | undefined;
|
|
72
|
+
}>(records: T[]): T[];
|
|
73
|
+
export declare function removeTailwindEntryDirectivesFromCss(css: string): string;
|
|
74
|
+
interface NormalizeInjectableCssResult {
|
|
75
|
+
css: string;
|
|
76
|
+
importedStyleFiles: Set<string>;
|
|
77
|
+
}
|
|
78
|
+
export declare function normalizeInjectableCssForTarget(css: string, file: string): string;
|
|
79
|
+
export declare function normalizeInjectableCssForTargetWithImports(css: string, file: string): NormalizeInjectableCssResult;
|
|
80
|
+
export declare function isStyleImportRequest(request: string | undefined): boolean;
|
|
81
|
+
export declare function collectImportedStyleFiles(css: string, targetFile: string): Set<string>;
|
|
82
|
+
export declare function normalizeMarkerOutputFile(markerFile: string, resolveViteProcessedCssOutputFile: ((file: string) => string | undefined) | undefined): string;
|
|
83
|
+
export declare function isMatchingGeneratedCssMarkerFile(targetFile: string, markerFile: string | undefined, resolveViteProcessedCssOutputFile: ((file: string) => string | undefined) | undefined): boolean;
|
|
84
|
+
export declare function resolveViteProcessedCssAssetSource(file: string, rawSource: string, resolveViteProcessedCssOutputFile: ((file: string) => string | undefined) | undefined): string;
|
|
85
|
+
export declare function collectMatchingGeneratedCssMarkerFiles(file: string, rawSource: string, resolveViteProcessedCssOutputFile: ((file: string) => string | undefined) | undefined): string[];
|
|
86
|
+
export declare function collectRootStyleBundleCssSources(bundle: OutputBundle, excludedFile: string): string[];
|
|
87
|
+
export declare function removeDuplicateUnlinkedRootCssAssetsReferencedByHtml(bundle: OutputBundle, options?: {
|
|
88
|
+
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
89
|
+
}): number;
|
|
@@ -1,71 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(asset: OutputAsset, file?: string): boolean;
|
|
6
|
-
}
|
|
7
|
-
interface CssAssetProcessedMarker {
|
|
8
|
-
(asset: OutputAsset, file?: string): void;
|
|
9
|
-
}
|
|
10
|
-
interface CssAssetResultRecordOptions {
|
|
11
|
-
injectIntoMain?: boolean | undefined;
|
|
12
|
-
outputFile?: string | undefined;
|
|
13
|
-
}
|
|
14
|
-
interface CssAssetResultRecorder {
|
|
15
|
-
(file: string, css: string, options?: CssAssetResultRecordOptions): void;
|
|
16
|
-
}
|
|
17
|
-
interface CssAssetResultsGetter {
|
|
18
|
-
(): Iterable<[string, string | {
|
|
19
|
-
css: string;
|
|
20
|
-
injectIntoMain?: boolean | undefined;
|
|
21
|
-
outputFile?: string | undefined;
|
|
22
|
-
}]>;
|
|
23
|
-
}
|
|
24
|
-
interface CollectViteProcessedCssAssetOptions {
|
|
25
|
-
opts?: InternalUserDefinedOptions | undefined;
|
|
26
|
-
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
27
|
-
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
28
|
-
isViteProcessedCssAsset?: CssAssetMarkerMatcher | undefined;
|
|
29
|
-
markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
|
|
30
|
-
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
31
|
-
recordViteProcessedCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
32
|
-
resolveViteProcessedCssOutputFile?: ((file: string) => string | undefined) | undefined;
|
|
33
|
-
subpackageRoots?: Set<string> | undefined;
|
|
34
|
-
transformCss?: ((css: string, file: string) => string) | undefined;
|
|
35
|
-
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
36
|
-
}
|
|
37
|
-
interface InjectViteProcessedCssAssetOptions {
|
|
38
|
-
opts: InternalUserDefinedOptions;
|
|
39
|
-
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
40
|
-
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
41
|
-
getViteProcessedCssAssetResults?: CssAssetResultsGetter | undefined;
|
|
42
|
-
markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
|
|
43
|
-
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
44
|
-
shouldRemoveInjectedSourceAsset?: ((file: string, record: {
|
|
45
|
-
file: string;
|
|
46
|
-
css: string;
|
|
47
|
-
injectIntoMain?: boolean | undefined;
|
|
48
|
-
outputFile?: string | undefined;
|
|
49
|
-
}) => boolean) | undefined;
|
|
50
|
-
transformCss?: ((css: string, file: string) => string) | undefined;
|
|
51
|
-
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
52
|
-
onUpdate?: ((file: string, original: string, generated: string) => void) | undefined;
|
|
53
|
-
}
|
|
54
|
-
export declare function removeDuplicateUnlinkedRootCssAssetsReferencedByHtml(bundle: OutputBundle, options?: {
|
|
55
|
-
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
56
|
-
}): number;
|
|
57
|
-
export declare function removeScopedTailwindPreflightCss(css: string): string;
|
|
58
|
-
export declare function removeCssCoveredByRootStyleBundleSources(bundle: OutputBundle, file: string, css: string): string;
|
|
59
|
-
export declare function removeCssCoveredByRootStyleAssets(bundle: OutputBundle, options: {
|
|
60
|
-
cssMatcher: (file: string) => boolean;
|
|
61
|
-
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
62
|
-
includeTailwindGeneratedCssAssets?: boolean | undefined;
|
|
63
|
-
isViteProcessedCssAsset?: CssAssetMarkerMatcher | undefined;
|
|
64
|
-
onUpdate?: ((file: string, original: string, generated: string) => void) | undefined;
|
|
65
|
-
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
66
|
-
subpackageRoots?: Set<string> | undefined;
|
|
67
|
-
}): number;
|
|
68
|
-
export declare function isCssImportOnlyBundleAsset(bundle: OutputBundle, file: string, css: string): boolean;
|
|
69
|
-
export declare function collectViteProcessedCssAssetResults(bundle: OutputBundle, options: CollectViteProcessedCssAssetOptions): number;
|
|
70
|
-
export declare function injectViteProcessedCssIntoMainCssAssets(bundle: OutputBundle, options: InjectViteProcessedCssAssetOptions): number;
|
|
71
|
-
export {};
|
|
1
|
+
export { isCssImportOnlyBundleAsset } from './processed-css-assets/cleanup';
|
|
2
|
+
export { collectViteProcessedCssAssetResults, injectViteProcessedCssIntoMainCssAssets } from './processed-css-assets/collector';
|
|
3
|
+
export { removeCssCoveredByRootStyleAssets, removeCssCoveredByRootStyleBundleSources, removeScopedTailwindPreflightCss } from './processed-css-assets/coverage';
|
|
4
|
+
export { removeDuplicateUnlinkedRootCssAssetsReferencedByHtml } from './processed-css-assets/markers-imports';
|
|
@@ -10,6 +10,7 @@ interface RewriteCssImportsOptions {
|
|
|
10
10
|
fileName: string;
|
|
11
11
|
source: string;
|
|
12
12
|
}) => string;
|
|
13
|
+
frameworkPostcssStage?: 'complete' | 'pending' | undefined;
|
|
13
14
|
}) => Promise<string | undefined> | string | undefined) | undefined;
|
|
14
15
|
shouldOwnTailwindGeneration?: boolean | undefined;
|
|
15
16
|
shouldRewrite: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
interface
|
|
2
|
+
interface ViteCssGenerationOptions {
|
|
3
3
|
generateCss: (id: string, code: string, hookContext?: {
|
|
4
4
|
addWatchFile?: (id: string) => void;
|
|
5
5
|
emitFile?: (emittedFile: {
|
|
@@ -7,10 +7,12 @@ interface ViteServeCssGenerationOptions {
|
|
|
7
7
|
fileName: string;
|
|
8
8
|
source: string;
|
|
9
9
|
}) => string;
|
|
10
|
+
frameworkPostcssStage?: 'complete' | 'pending' | undefined;
|
|
10
11
|
}) => Promise<string | undefined> | string | undefined;
|
|
11
12
|
getCommand: () => string | undefined;
|
|
12
13
|
onTailwindRootCss?: ((id: string, code: string) => Promise<void> | void) | undefined;
|
|
13
14
|
shouldGenerate: () => boolean;
|
|
15
|
+
shouldGenerateBuild?: (() => boolean) | undefined;
|
|
14
16
|
}
|
|
15
|
-
export declare function
|
|
17
|
+
export declare function createViteCssGenerationPlugins(options: ViteCssGenerationOptions): Plugin[];
|
|
16
18
|
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { Plugin, ResolvedConfig } from 'vite';
|
|
2
2
|
import type { ViteFrameworkName } from '../../framework-selector';
|
|
3
|
+
import type { createViteRuntimeClassSet } from '../runtime-class-set';
|
|
3
4
|
import type { ViteFrameworkCssPipelineStrategy, ViteFrameworkExtraPluginPlatform, ViteFrameworkRuntimeFeatureContext } from './framework-strategy';
|
|
5
|
+
import type { getCompilerContext } from '../../../context';
|
|
6
|
+
import type { toCustomAttributesEntities } from '../../../context/custom-attributes';
|
|
4
7
|
import type { ViteStyleInjectorDelegateFactory } from '../../../style-injector/internal';
|
|
5
8
|
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
6
|
-
import { getCompilerContext } from '../../../context';
|
|
7
|
-
import { toCustomAttributesEntities } from '../../../context/custom-attributes';
|
|
8
|
-
import { createViteRuntimeClassSet } from '../runtime-class-set';
|
|
9
9
|
export interface WeappTailwindcssVitePlugin {
|
|
10
10
|
name: string;
|
|
11
11
|
[hook: string]: any;
|
|
12
12
|
}
|
|
13
13
|
export interface ViteFrameworkBranchContext {
|
|
14
14
|
frameworkName: ViteFrameworkName;
|
|
15
|
+
adaptWatchCssBeforeFrameworkCache?: boolean;
|
|
15
16
|
createExtraPlugins?: (context: ViteFrameworkExtraPluginContext) => Plugin[];
|
|
16
|
-
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy
|
|
17
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy;
|
|
17
18
|
getExtraPluginPlatform?: () => ViteFrameworkExtraPluginPlatform;
|
|
18
19
|
styleInjectorDelegate: ViteStyleInjectorDelegateFactory;
|
|
19
20
|
isRuntimeClassSetFeatureEnabled?: (context: ViteFrameworkRuntimeFeatureContext) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SourceCandidateCollector, SourceCandidateCollectorOptions } from './types-and-cache';
|
|
2
|
+
export declare function createSourceCandidateCollector(options?: SourceCandidateCollectorOptions): SourceCandidateCollector;
|
|
3
|
+
export declare function getSourceCandidateContentCacheStatsForTest(): {
|
|
4
|
+
max: number;
|
|
5
|
+
size: number;
|
|
6
|
+
keys: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function clearSourceCandidateContentCacheForTest(): void;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
2
|
+
import type { ICustomAttributesEntities } from '../../../types';
|
|
3
|
+
import type { IArbitraryValues } from '../../../types/shared';
|
|
4
|
+
import { LRUCache } from 'lru-cache';
|
|
5
|
+
export interface SourceCandidateStore {
|
|
6
|
+
syncSource: (id: string, source: string) => Promise<void>;
|
|
7
|
+
sync: (id: string, source: string) => Promise<void>;
|
|
8
|
+
syncCss: (id: string, source: string) => Promise<void>;
|
|
9
|
+
merge: (id: string, source: string) => Promise<void>;
|
|
10
|
+
syncFile: (id: string) => Promise<void>;
|
|
11
|
+
syncCurrentSource: (id: string, source: string) => Promise<SourceCandidateChange>;
|
|
12
|
+
syncCurrentFile: (id: string) => Promise<SourceCandidateChange>;
|
|
13
|
+
scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
|
|
14
|
+
syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
|
|
15
|
+
remove: (id: string) => SourceCandidateChange;
|
|
16
|
+
source: (id: string) => string | undefined;
|
|
17
|
+
sources: () => IterableIterator<[string, string]>;
|
|
18
|
+
values: () => Set<string>;
|
|
19
|
+
valuesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>;
|
|
20
|
+
sourcesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>;
|
|
21
|
+
snapshot: () => SourceCandidateCollectorSnapshot;
|
|
22
|
+
restore: (snapshot: SourceCandidateCollectorSnapshot) => void;
|
|
23
|
+
clearScan: () => void;
|
|
24
|
+
resetScan: () => void;
|
|
25
|
+
clear: () => void;
|
|
26
|
+
}
|
|
27
|
+
export interface SourceCandidateCollector extends SourceCandidateStore {
|
|
28
|
+
}
|
|
29
|
+
export interface SourceCandidateChange {
|
|
30
|
+
addedCandidates: Set<string>;
|
|
31
|
+
removedCandidates: Set<string>;
|
|
32
|
+
}
|
|
33
|
+
export interface SourceCandidateCollectorSnapshot {
|
|
34
|
+
candidatesById: Array<[string, string[]]>;
|
|
35
|
+
cssCandidatesById?: Array<[string, string[]]> | undefined;
|
|
36
|
+
cssSourceById?: Array<[string, string]> | undefined;
|
|
37
|
+
scanCandidatesById?: Array<[string, string[]]> | undefined;
|
|
38
|
+
scanSourceById?: Array<[string, string]> | undefined;
|
|
39
|
+
sourceById?: Array<[string, string]> | undefined;
|
|
40
|
+
transformCandidatesById?: Array<[string, string[]]> | undefined;
|
|
41
|
+
transformSourceById?: Array<[string, string]> | undefined;
|
|
42
|
+
inlineExcludedCandidates: string[];
|
|
43
|
+
inlineIncludedCandidates: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface SourceCandidateFilterOptions {
|
|
46
|
+
excludeEntries?: TailwindSourceEntry[] | undefined;
|
|
47
|
+
}
|
|
48
|
+
export interface ScanSourceCandidateRootOptions {
|
|
49
|
+
root: string;
|
|
50
|
+
outDir?: string | undefined;
|
|
51
|
+
entries?: TailwindSourceEntry[] | undefined;
|
|
52
|
+
explicit?: boolean | undefined;
|
|
53
|
+
}
|
|
54
|
+
export interface SourceCandidateCollectorOptions {
|
|
55
|
+
bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
|
|
56
|
+
customAttributesEntities?: ICustomAttributesEntities | undefined;
|
|
57
|
+
disabledDefaultTemplateHandler?: boolean | undefined;
|
|
58
|
+
extractor?: ((source: string, extension: string) => Promise<Iterable<string>> | Iterable<string>) | undefined;
|
|
59
|
+
}
|
|
60
|
+
export declare const SOURCE_CANDIDATE_CONTENT_CACHE_MAX = 128;
|
|
61
|
+
export declare const sourceCandidateContentCache: LRUCache<string, string[], unknown>;
|
|
62
|
+
export declare function cleanUrl(id: string): string;
|
|
63
|
+
export declare function resolveSourceCandidateExtension(id: string): string;
|
|
64
|
+
export declare function createSourceCandidateContentCacheKey(extension: string, source: string, bareArbitraryValues: IArbitraryValues['bareArbitraryValues'] | undefined, customAttributesEntities: ICustomAttributesEntities | undefined, disabledDefaultTemplateHandler: boolean | undefined, extractor: SourceCandidateCollectorOptions['extractor']): string;
|
|
65
|
+
export declare function extractCandidates(source: string, extension: string, options: SourceCandidateCollectorOptions): Promise<Set<string>>;
|
|
66
|
+
export declare function isSourceCandidateRequest(id: string): boolean;
|
|
67
|
+
export declare function removeCandidateSet(candidateCount: Map<string, number>, candidates: Set<string>): void;
|
|
68
|
+
export declare function addCandidateSet(candidateCount: Map<string, number>, candidates: Set<string>): void;
|
|
69
|
+
export declare function diffCandidateSets(previous: Set<string>, next: Set<string>): SourceCandidateChange;
|
|
@@ -1,68 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
syncSource: (id: string, source: string) => Promise<void>;
|
|
6
|
-
sync: (id: string, source: string) => Promise<void>;
|
|
7
|
-
syncCss: (id: string, source: string) => Promise<void>;
|
|
8
|
-
merge: (id: string, source: string) => Promise<void>;
|
|
9
|
-
syncFile: (id: string) => Promise<void>;
|
|
10
|
-
syncCurrentSource: (id: string, source: string) => Promise<SourceCandidateChange>;
|
|
11
|
-
syncCurrentFile: (id: string) => Promise<SourceCandidateChange>;
|
|
12
|
-
scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
|
|
13
|
-
syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
|
|
14
|
-
remove: (id: string) => SourceCandidateChange;
|
|
15
|
-
source: (id: string) => string | undefined;
|
|
16
|
-
sources: () => IterableIterator<[string, string]>;
|
|
17
|
-
values: () => Set<string>;
|
|
18
|
-
valuesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>;
|
|
19
|
-
sourcesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>;
|
|
20
|
-
snapshot: () => SourceCandidateCollectorSnapshot;
|
|
21
|
-
restore: (snapshot: SourceCandidateCollectorSnapshot) => void;
|
|
22
|
-
clearScan: () => void;
|
|
23
|
-
resetScan: () => void;
|
|
24
|
-
clear: () => void;
|
|
25
|
-
}
|
|
26
|
-
export interface SourceCandidateCollector extends SourceCandidateStore {
|
|
27
|
-
}
|
|
28
|
-
export interface SourceCandidateChange {
|
|
29
|
-
addedCandidates: Set<string>;
|
|
30
|
-
removedCandidates: Set<string>;
|
|
31
|
-
}
|
|
32
|
-
export interface SourceCandidateCollectorSnapshot {
|
|
33
|
-
candidatesById: Array<[string, string[]]>;
|
|
34
|
-
cssCandidatesById?: Array<[string, string[]]> | undefined;
|
|
35
|
-
cssSourceById?: Array<[string, string]> | undefined;
|
|
36
|
-
scanCandidatesById?: Array<[string, string[]]> | undefined;
|
|
37
|
-
scanSourceById?: Array<[string, string]> | undefined;
|
|
38
|
-
sourceById?: Array<[string, string]> | undefined;
|
|
39
|
-
transformCandidatesById?: Array<[string, string[]]> | undefined;
|
|
40
|
-
transformSourceById?: Array<[string, string]> | undefined;
|
|
41
|
-
inlineExcludedCandidates: string[];
|
|
42
|
-
inlineIncludedCandidates: string[];
|
|
43
|
-
}
|
|
44
|
-
export interface SourceCandidateFilterOptions {
|
|
45
|
-
excludeEntries?: TailwindSourceEntry[] | undefined;
|
|
46
|
-
}
|
|
47
|
-
interface ScanSourceCandidateRootOptions {
|
|
48
|
-
root: string;
|
|
49
|
-
outDir?: string | undefined;
|
|
50
|
-
entries?: TailwindSourceEntry[] | undefined;
|
|
51
|
-
explicit?: boolean | undefined;
|
|
52
|
-
}
|
|
53
|
-
export interface SourceCandidateCollectorOptions {
|
|
54
|
-
bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
|
|
55
|
-
customAttributesEntities?: ICustomAttributesEntities | undefined;
|
|
56
|
-
disabledDefaultTemplateHandler?: boolean | undefined;
|
|
57
|
-
extractor?: ((source: string, extension: string) => Promise<Iterable<string>> | Iterable<string>) | undefined;
|
|
58
|
-
}
|
|
59
|
-
export declare function isSourceCandidateRequest(id: string): boolean;
|
|
60
|
-
export declare function createSourceCandidateStore(options?: SourceCandidateCollectorOptions): SourceCandidateStore;
|
|
61
|
-
export declare function createSourceCandidateCollector(options?: SourceCandidateCollectorOptions): SourceCandidateCollector;
|
|
62
|
-
export declare function getSourceCandidateContentCacheStatsForTest(): {
|
|
63
|
-
max: number;
|
|
64
|
-
size: number;
|
|
65
|
-
keys: string[];
|
|
66
|
-
};
|
|
67
|
-
export declare function clearSourceCandidateContentCacheForTest(): void;
|
|
68
|
-
export {};
|
|
1
|
+
export { clearSourceCandidateContentCacheForTest, createSourceCandidateCollector, getSourceCandidateContentCacheStatsForTest } from './source-candidates/collector';
|
|
2
|
+
export { createSourceCandidateStore } from './source-candidates/store';
|
|
3
|
+
export { isSourceCandidateRequest } from './source-candidates/types-and-cache';
|
|
4
|
+
export type { SourceCandidateChange, SourceCandidateCollector, SourceCandidateCollectorOptions, SourceCandidateCollectorSnapshot, SourceCandidateFilterOptions, SourceCandidateStore } from './source-candidates/types-and-cache';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResolvedConfig } from 'vite';
|
|
2
|
+
export interface FrameworkWatchCssAdaptationOptions {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
isWatchBuild: boolean;
|
|
5
|
+
isWebGeneratorBranch: boolean;
|
|
6
|
+
ownsTailwindGeneration: boolean;
|
|
7
|
+
platform?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function shouldAdaptFrameworkWatchCssBeforeCache(options: FrameworkWatchCssAdaptationOptions): boolean;
|
|
10
|
+
export declare function wrapViteCssPostTransform(config: ResolvedConfig, transformCss: (css: string, id: string) => Promise<string>): boolean;
|
|
@@ -14,11 +14,13 @@ interface ChunkLike {
|
|
|
14
14
|
interface ModuleLike {
|
|
15
15
|
context?: string;
|
|
16
16
|
dependencies?: Array<unknown> | Iterable<unknown>;
|
|
17
|
+
identifier?: () => string;
|
|
17
18
|
modules?: ModuleLike[] | Iterable<ModuleLike>;
|
|
18
19
|
request?: string;
|
|
19
20
|
resource?: string;
|
|
20
21
|
rootModule?: ModuleLike;
|
|
21
22
|
userRequest?: string;
|
|
23
|
+
type?: string;
|
|
22
24
|
}
|
|
23
25
|
interface ChunkGraphLike {
|
|
24
26
|
getChunkModulesIterable?: (chunk: ChunkLike) => Iterable<ModuleLike> | undefined;
|
|
@@ -42,6 +44,10 @@ export declare function createWebpackCssAssetResourceMap(chunks: Iterable<ChunkL
|
|
|
42
44
|
context?: string;
|
|
43
45
|
resource?: string;
|
|
44
46
|
}) => string | undefined): Map<string, Set<string>>;
|
|
47
|
+
export declare function createWebpackDirectCssAssetResourceMap(chunks: Iterable<ChunkLike>, chunkGraph: ChunkGraphLike | undefined, cssMatcher: (file: string) => boolean, normalizeResource: (resource: string, issuer?: {
|
|
48
|
+
context?: string;
|
|
49
|
+
resource?: string;
|
|
50
|
+
}) => string | undefined): Map<string, Set<string>>;
|
|
45
51
|
export declare function createAssetHashByChunkMap(chunks: Iterable<ChunkLike>): Map<string, string>;
|
|
46
52
|
export declare function createRuntimeAwareCssHash(assetHash: string | undefined, sourceHash: string, runtimeSetHash: string): string;
|
|
47
53
|
export declare function hasWatchChanges(compiler: WebpackWatchChangeLike): boolean;
|
|
@@ -20,6 +20,7 @@ export declare function createWebpackCssSourceResolvers(options: {
|
|
|
20
20
|
};
|
|
21
21
|
cssAssetFiles: Iterable<string>;
|
|
22
22
|
cssAssetResources: ReadonlyMap<string, ReadonlySet<string>>;
|
|
23
|
+
directCssAssetResources: ReadonlyMap<string, ReadonlySet<string>>;
|
|
23
24
|
cssHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>;
|
|
24
25
|
cssSources: Map<string, {
|
|
25
26
|
css: string | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { createEscapeFragments } from '../../../../vite/incremental-runtime-class-set/escaped-candidates';
|
|
2
|
+
import type { SetupWebpackV5ProcessAssetsHookOptions, WebpackSourceLike } from '../helpers';
|
|
3
|
+
import type { WebpackCssHandlerOptions, WebpackSourceCandidateCache } from './preflight-runtime';
|
|
4
|
+
export declare function finalizeTracedWebpackCssAsset(css: string, cssHandlerOptions: WebpackCssHandlerOptions, options: {
|
|
5
|
+
annotateCss: (css: string) => string;
|
|
6
|
+
compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'];
|
|
7
|
+
finalized?: boolean | undefined;
|
|
8
|
+
isWebGeneratorTarget: boolean;
|
|
9
|
+
}): string;
|
|
10
|
+
export declare function finalizeWebpackCssAssetSource(source: string, compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], isWebGeneratorTarget: boolean, options?: {
|
|
11
|
+
cssPreflight?: boolean | undefined;
|
|
12
|
+
generatedCss?: boolean;
|
|
13
|
+
preserveExistingPreflight?: boolean | undefined;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function finalizeWebpackCssAssetOutputSource(source: string, compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], isWebGeneratorTarget: boolean): string;
|
|
16
|
+
export declare function collectWebpackJsRuntimeCandidatesFromAssets(options: {
|
|
17
|
+
escapeFragments: ReturnType<typeof createEscapeFragments>;
|
|
18
|
+
getAssetSource: (file: string) => WebpackSourceLike | undefined;
|
|
19
|
+
isWebGeneratorTarget: boolean;
|
|
20
|
+
jsAssets: Iterable<string>;
|
|
21
|
+
}): Set<string> | undefined;
|
|
22
|
+
export declare function collectWebpackJsRuntimeTokenSignature(options: {
|
|
23
|
+
getAssetSource: (file: string) => WebpackSourceLike | undefined;
|
|
24
|
+
isWebGeneratorTarget: boolean;
|
|
25
|
+
jsAssets: Iterable<string>;
|
|
26
|
+
}): string;
|
|
27
|
+
export declare function addRuntimeTransformCandidates(target: Set<string>, candidates: ReadonlySet<string> | undefined): void;
|
|
28
|
+
export declare function createWebpackCssSourceTraceTokenSources(compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], webpackSourceCandidates: WebpackSourceCandidateCache | undefined): import("../../../../shared/css-source-trace").CssTokenSourceMap | undefined;
|
|
29
|
+
export declare function stringifyOptionalWebpackSourceValue(value: unknown): string;
|
|
30
|
+
export declare function stringifyWebpackSourceLike(source: WebpackSourceLike): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function parseWebpackCssLayerNames(params: string): string[];
|
|
2
|
+
export declare function removeWebpackTailwindGeneratedAssetCss(source: string): string;
|
|
3
|
+
export declare function isOnlyWebpackTailwindGeneratedPreflightCss(source: string): boolean;
|
|
4
|
+
export declare function collectWebpackCssRuleIdentityMarkers(source: string): Set<string>;
|
|
5
|
+
export declare function unescapeCssIdentifier(value: string): string;
|
|
6
|
+
export declare function collectGeneratedCssRuntimeCandidates(source: string): Set<string>;
|
|
7
|
+
export declare function hasAdditionalWebpackAssetUserCssMarkers(rawSource: string, generatorRawSource: string): boolean;
|
|
8
|
+
export declare function hasWebpackTailwindSourceDirectives(source: string | undefined): boolean;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { SetupWebpackV5ProcessAssetsHookOptions } from '../helpers';
|
|
2
|
+
import type { WebpackSourceCandidateScanMemoryStats } from '../source-candidate-cache';
|
|
3
|
+
import type { WebpackCssHandlerOptions } from './preflight-runtime';
|
|
4
|
+
export declare function resolveWebpackMemoryDebugStats(context: {
|
|
5
|
+
activeAssetFiles: number;
|
|
6
|
+
activeCssFiles: number;
|
|
7
|
+
activeProcessCacheKeys: Set<string>;
|
|
8
|
+
activeProcessHashKeys: Set<string | number>;
|
|
9
|
+
cache: SetupWebpackV5ProcessAssetsHookOptions['options']['cache'];
|
|
10
|
+
cssHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>;
|
|
11
|
+
cssUserHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>;
|
|
12
|
+
phase: string;
|
|
13
|
+
sourceCandidateScan: WebpackSourceCandidateScanMemoryStats;
|
|
14
|
+
}): {
|
|
15
|
+
phase: string;
|
|
16
|
+
process: {
|
|
17
|
+
rssMb: number;
|
|
18
|
+
heapTotalMb: number;
|
|
19
|
+
heapUsedMb: number;
|
|
20
|
+
externalMb: number;
|
|
21
|
+
arrayBuffersMb: number;
|
|
22
|
+
};
|
|
23
|
+
assets: {
|
|
24
|
+
active: number;
|
|
25
|
+
activeCss: number;
|
|
26
|
+
};
|
|
27
|
+
processCache: {
|
|
28
|
+
instance: number;
|
|
29
|
+
hashMap: number;
|
|
30
|
+
activeCacheKeys: number;
|
|
31
|
+
activeHashKeys: number;
|
|
32
|
+
staleCacheKeys: number;
|
|
33
|
+
staleHashKeys: number;
|
|
34
|
+
pruned: boolean;
|
|
35
|
+
pruneSkipped: boolean;
|
|
36
|
+
};
|
|
37
|
+
webpackCss: {
|
|
38
|
+
handlerOptions: number;
|
|
39
|
+
userHandlerOptions: number;
|
|
40
|
+
maxHandlerOptions: number;
|
|
41
|
+
};
|
|
42
|
+
sourceCandidateScan: WebpackSourceCandidateScanMemoryStats;
|
|
43
|
+
tailwind: {
|
|
44
|
+
v4: {
|
|
45
|
+
max: number;
|
|
46
|
+
entryCandidatesMax: number;
|
|
47
|
+
entryCssBytesMax: number;
|
|
48
|
+
size: number;
|
|
49
|
+
taskMax: number;
|
|
50
|
+
taskSize: number;
|
|
51
|
+
entries: {
|
|
52
|
+
candidates: number;
|
|
53
|
+
classSet: number;
|
|
54
|
+
cssBytes: number;
|
|
55
|
+
rawCssBytes: number;
|
|
56
|
+
keyHash: string;
|
|
57
|
+
keyBytes: number;
|
|
58
|
+
}[];
|
|
59
|
+
keys: {
|
|
60
|
+
keyHash: string;
|
|
61
|
+
keyBytes: number;
|
|
62
|
+
}[];
|
|
63
|
+
taskKeys: {
|
|
64
|
+
keyHash: string;
|
|
65
|
+
keyBytes: number;
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
} | undefined;
|
|
70
|
+
export declare function shouldInjectWebpackCssTracePreflight(_appType: SetupWebpackV5ProcessAssetsHookOptions['appType'], cssHandlerOptions: Pick<WebpackCssHandlerOptions, 'isMainChunk' | 'sourceOptions'>): boolean;
|
|
71
|
+
export declare function finalizeMiniProgramUserCssAssetSource(source: string, compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], isWebGeneratorTarget: boolean, options?: {
|
|
72
|
+
cssPreflight?: boolean | undefined;
|
|
73
|
+
}): string;
|
|
74
|
+
export declare function shouldFallbackToWebpackUserCssOnGeneratorError(options: {
|
|
75
|
+
configuredMainCssEntryFilesLength: number;
|
|
76
|
+
generatorRawSource: string;
|
|
77
|
+
hasExplicitTailwindV4SourceCss: boolean;
|
|
78
|
+
}): boolean;
|
package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { TailwindV4CssSource } from '../../../../shared/generator-css/source-resolver/types';
|
|
2
|
+
import type { SourceCandidateStore } from '../../../../vite/source-candidates';
|
|
3
|
+
import type { SetupWebpackV5ProcessAssetsHookOptions } from '../helpers';
|
|
4
|
+
import type { resolveStyleOptionsFromContext } from '../../../../../context/style-options';
|
|
5
|
+
import type { TailwindcssRuntimeLike } from '../../../../../types';
|
|
6
|
+
export { isRuntimeTransformCandidate } from './runtime-candidates';
|
|
7
|
+
export interface WebpackCssHandlerOptions {
|
|
8
|
+
isMainChunk: boolean;
|
|
9
|
+
postcssOptions: {
|
|
10
|
+
options: {
|
|
11
|
+
from: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
majorVersion?: 4 | undefined;
|
|
15
|
+
sourceOptions?: {
|
|
16
|
+
cssSources?: TailwindV4CssSource[] | undefined;
|
|
17
|
+
outputRoot?: string | undefined;
|
|
18
|
+
sourceCss?: string | undefined;
|
|
19
|
+
sourceFile?: string | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare const WEBPACK_CSS_HANDLER_OPTIONS_CACHE_MAX = 128;
|
|
23
|
+
export declare function resolveConfiguredWebpackCssPreflight(compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], styleOptions: ReturnType<typeof resolveStyleOptionsFromContext>): import("@weapp-tailwindcss/postcss").CssPreflightOptions;
|
|
24
|
+
export declare function resolveExistingWebpackCssPreflight(compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'], styleOptions: ReturnType<typeof resolveStyleOptionsFromContext>, source: string): import("@weapp-tailwindcss/postcss").CssPreflightOptions | undefined;
|
|
25
|
+
export declare function removeMiniProgramPreflightSelectorRule(source: string): string;
|
|
26
|
+
export declare function dedupeMiniProgramPreflightSelectorRules(source: string): string;
|
|
27
|
+
export declare function hasMiniProgramPreflightSelector(source: string): boolean;
|
|
28
|
+
export declare function ensureWebpackMiniProgramTwContentInit(source: string): string;
|
|
29
|
+
export declare function removeTailwindV4StandaloneHostPreflightRule(source: string): string;
|
|
30
|
+
export interface WebpackSourceCandidateCache {
|
|
31
|
+
getSourceCandidatesForEntries: SourceCandidateStore['valuesForEntries'];
|
|
32
|
+
signatureHash: string;
|
|
33
|
+
tokenSources: ReturnType<SourceCandidateStore['sourcesForEntries']>;
|
|
34
|
+
}
|
|
35
|
+
export declare function collectRuntimeTokenSignatureParts(source: string): [] | RegExpMatchArray;
|
|
36
|
+
export declare function hasMissingRuntimeCandidates(classSet: ReadonlySet<string> | undefined, candidates: ReadonlySet<string> | undefined): boolean;
|
|
37
|
+
export declare function hasStaleRuntimeCandidates(classSet: ReadonlySet<string> | undefined, candidates: ReadonlySet<string> | undefined): boolean;
|
|
38
|
+
export declare function resolveGeneratedCssRuntimeCandidates(source: string, fallbackClassSet?: ReadonlySet<string> | undefined): ReadonlySet<string>;
|
|
39
|
+
export declare function getRuntimeClassSetSync(tailwindRuntime: TailwindcssRuntimeLike): Set<string>;
|
|
40
|
+
export declare function toMb(bytes: number): number;
|
|
41
|
+
export declare function pruneMapToMaxSize<Key, Value>(map: Map<Key, Value>, maxSize: number): void;
|
|
42
|
+
export declare function stripTrailingLineWhitespace(source: string): string;
|
|
43
|
+
export declare function pruneWebpackCssHandlerOptionCaches(cssHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>, cssUserHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>, activeCssFiles: Set<string>): void;
|