weapp-tailwindcss 5.1.15 → 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/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 +2 -2
- package/dist/bundlers/shared/framework-postcss.d.ts +14 -0
- 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/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/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/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/v4-generation-core.d.ts +3 -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/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-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 +1 -0
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +2 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +4 -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/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 -219
- 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 +5 -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-BgGWVAmN.mjs → context-JzwzSX36.mjs} +3 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-CEnUsjed.js → generator-B91GhUJQ.js} +636 -505
- package/dist/{generator-CEo920So.mjs → generator-Bv7myuhY.mjs} +556 -431
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-DP71z1jG.mjs → gulp-CKSklPlH.mjs} +217 -186
- package/dist/{gulp-3m1dAiig.js → gulp-Q1wITegn.js} +217 -186
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-1aS6--U7.mjs → hmr-timing-BXg7nI8N.mjs} +3411 -3276
- package/dist/{hmr-timing-B8p4f0ca.js → hmr-timing-CMPaWn9P.js} +3425 -3278
- 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/{source-candidate-scan-signature-BAahhiwb.js → source-candidate-scan-signature-BKZZk_e6.js} +144 -4
- package/dist/{source-candidate-scan-signature-Cf7259PR.mjs → source-candidate-scan-signature-CtK-mB_C.mjs} +127 -4
- 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-xs704TRw.mjs → tailwindcss-BTcXX8Ka.mjs} +2 -2
- package/dist/{vite-nXZEiwG0.mjs → vite-BwQWl9ft.mjs} +806 -692
- package/dist/{vite-DUVjMduj.js → vite-DhVnXvAQ.js} +805 -691
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-generation-loader.js +1 -1
- package/dist/{weapp-tw-css-import-rewrite-loader-DNk0IxAt.js → weapp-tw-css-import-rewrite-loader-B0tVkJLH.js} +2410 -2084
- package/dist/weapp-tw-css-import-rewrite-loader.js +1 -1
- package/dist/weapp-tw-runtime-classset-loader.js +10 -4
- package/dist/{webpack-C_UUFRgj.mjs → webpack-Bo1QrFPf.mjs} +1387 -1114
- package/dist/{webpack-nppysF4B.js → webpack-kh78iMSS.js} +1386 -1113
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +9 -7
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { OutputAsset } from 'rollup';
|
|
3
|
+
import type { ResolvedConfig } from 'vite';
|
|
4
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../shared/framework-strategy';
|
|
5
|
+
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
6
|
+
import type { InternalUserDefinedOptions } from '../../../types';
|
|
7
|
+
interface RememberedMainCssSource {
|
|
8
|
+
rawSource: string;
|
|
9
|
+
sourceFile: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CssFinalizerContext {
|
|
12
|
+
opts: InternalUserDefinedOptions;
|
|
13
|
+
runtimeState: {
|
|
14
|
+
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
15
|
+
readyPromise: Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
18
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
19
|
+
isCssAssetProcessed: (asset: OutputAsset, file?: string) => boolean;
|
|
20
|
+
markCssAssetProcessed: (asset: OutputAsset, file?: string) => void;
|
|
21
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
22
|
+
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
23
|
+
recordCssAssetResult?: (file: string, css: string) => void;
|
|
24
|
+
recordViteProcessedCssAssetResult?: (file: string, css: string, options?: {
|
|
25
|
+
injectIntoMain?: boolean | undefined;
|
|
26
|
+
outputFile?: string | undefined;
|
|
27
|
+
}) => void;
|
|
28
|
+
getViteProcessedCssAssetResults?: () => Iterable<[string, string | {
|
|
29
|
+
css: string;
|
|
30
|
+
injectIntoMain?: boolean | undefined;
|
|
31
|
+
outputFile?: string | undefined;
|
|
32
|
+
}]>;
|
|
33
|
+
getRecordedGeneratorCandidates?: () => Set<string> | undefined;
|
|
34
|
+
getSourceCandidates?: () => Set<string>;
|
|
35
|
+
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
|
|
36
|
+
getSourceCandidateSourcesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Map<string, Set<string>>) | undefined;
|
|
37
|
+
waitForSourceCandidateSyncs?: () => Promise<void>;
|
|
38
|
+
rememberMainCssSource?: (file: string, rawSource: string) => void;
|
|
39
|
+
getRememberedMainCssSource?: (file: string) => RememberedMainCssSource | undefined;
|
|
40
|
+
isViteProcessedCssAsset?: (asset: OutputAsset, file?: string) => boolean;
|
|
41
|
+
frameworkRootImportShellTargetByFile?: ReadonlyMap<string, string> | undefined;
|
|
42
|
+
}
|
|
43
|
+
export interface CssFinalizerThis {
|
|
44
|
+
addWatchFile?: (id: string) => void;
|
|
45
|
+
}
|
|
46
|
+
export declare function inferPlatformFromViteOutDir(outDir: string | undefined): string | undefined;
|
|
47
|
+
export declare function registerGeneratorDependencies(ctx: CssFinalizerThis, dependencies: readonly string[] | undefined): void;
|
|
48
|
+
export declare function createCssHandlerOptions(opts: InternalUserDefinedOptions, majorVersion: number | undefined, file: string, outputRoot: string | undefined, extraOptions?: Record<string, unknown>): IStyleHandlerOptions;
|
|
49
|
+
export declare function shouldGenerateCssByGenerator(opts: InternalUserDefinedOptions, majorVersion: number | undefined, file: string, rawSource: string, processed: boolean): boolean;
|
|
50
|
+
export declare function collectViteProcessedCssSources(getViteProcessedCssAssetResults: CssFinalizerContext['getViteProcessedCssAssetResults']): string[];
|
|
51
|
+
export declare function finalizeWebCss(css: string, context: ViteFrameworkCssPipelineContext & {
|
|
52
|
+
file: string;
|
|
53
|
+
}, cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined): string;
|
|
54
|
+
export {};
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Plugin, ResolvedConfig } from 'vite';
|
|
3
|
-
import type { ViteFrameworkCssPipelineStrategy } from './shared/framework-strategy';
|
|
4
|
-
import type { TailwindSourceEntry } from '../../tailwindcss/source-scan';
|
|
5
|
-
import type { InternalUserDefinedOptions } from '../../types';
|
|
6
|
-
interface RememberedMainCssSource {
|
|
7
|
-
rawSource: string;
|
|
8
|
-
sourceFile: string;
|
|
9
|
-
}
|
|
10
|
-
interface CssFinalizerContext {
|
|
11
|
-
opts: InternalUserDefinedOptions;
|
|
12
|
-
runtimeState: {
|
|
13
|
-
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
14
|
-
readyPromise: Promise<void>;
|
|
15
|
-
};
|
|
16
|
-
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
17
|
-
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
18
|
-
isCssAssetProcessed: (asset: OutputAsset, file?: string) => boolean;
|
|
19
|
-
markCssAssetProcessed: (asset: OutputAsset, file?: string) => void;
|
|
20
|
-
debug: (format: string, ...args: unknown[]) => void;
|
|
21
|
-
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
22
|
-
recordCssAssetResult?: (file: string, css: string) => void;
|
|
23
|
-
recordViteProcessedCssAssetResult?: (file: string, css: string, options?: {
|
|
24
|
-
injectIntoMain?: boolean | undefined;
|
|
25
|
-
outputFile?: string | undefined;
|
|
26
|
-
}) => void;
|
|
27
|
-
getViteProcessedCssAssetResults?: () => Iterable<[string, string | {
|
|
28
|
-
css: string;
|
|
29
|
-
injectIntoMain?: boolean | undefined;
|
|
30
|
-
outputFile?: string | undefined;
|
|
31
|
-
}]>;
|
|
32
|
-
getRecordedGeneratorCandidates?: () => Set<string> | undefined;
|
|
33
|
-
getSourceCandidates?: () => Set<string>;
|
|
34
|
-
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
|
|
35
|
-
getSourceCandidateSourcesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Map<string, Set<string>>) | undefined;
|
|
36
|
-
waitForSourceCandidateSyncs?: () => Promise<void>;
|
|
37
|
-
rememberMainCssSource?: (file: string, rawSource: string) => void;
|
|
38
|
-
getRememberedMainCssSource?: (file: string) => RememberedMainCssSource | undefined;
|
|
39
|
-
isViteProcessedCssAsset?: (asset: OutputAsset, file?: string) => boolean;
|
|
40
|
-
frameworkRootImportShellTargetByFile?: ReadonlyMap<string, string> | undefined;
|
|
41
|
-
}
|
|
42
|
-
export declare function createViteCssFinalizerOutputPlugin(context: CssFinalizerContext): Plugin;
|
|
43
|
-
export {};
|
|
1
|
+
export { createViteCssFinalizerOutputPlugin } from './css-finalizer/plugin';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { BundleBuildState, BundleSnapshot } from '../../bundle-state';
|
|
3
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../../shared/framework-strategy';
|
|
4
|
+
import type { BundleMetrics } from '../metrics';
|
|
5
|
+
import type { GenerateBundleContext } from '../types';
|
|
6
|
+
export interface FinalizeGenerateBundleOptions {
|
|
7
|
+
activeProcessCacheKeys: Set<string>;
|
|
8
|
+
activeProcessHashKeys: Set<string | number>;
|
|
9
|
+
activeViteCssCacheFiles: Set<string>;
|
|
10
|
+
bundle: Record<string, OutputAsset | OutputChunk>;
|
|
11
|
+
bundleFiles: string[];
|
|
12
|
+
cache: GenerateBundleContext['opts']['cache'];
|
|
13
|
+
cssTaskFactories: Array<() => Promise<void>>;
|
|
14
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
15
|
+
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
16
|
+
debug: GenerateBundleContext['debug'];
|
|
17
|
+
defaultStyleOutputExtension: string;
|
|
18
|
+
formatIteration: number;
|
|
19
|
+
generatorCandidateSignature: string;
|
|
20
|
+
generatorRuntime: Set<string>;
|
|
21
|
+
getCssHandlerOptions: (file: string) => ReturnType<ReturnType<typeof import('./css-handler-options').createCssHandlerOptionsCache>['getCssHandlerOptions']>;
|
|
22
|
+
getSourceCandidateSourcesForEntries: GenerateBundleContext['getSourceCandidateSourcesForEntries'];
|
|
23
|
+
getSourceCandidatesForEntries: GenerateBundleContext['getSourceCandidatesForEntries'];
|
|
24
|
+
getViteCssCacheStats: GenerateBundleContext['getViteCssCacheStats'];
|
|
25
|
+
getViteProcessedCssAssetResults: GenerateBundleContext['getViteProcessedCssAssetResults'];
|
|
26
|
+
hmrTimingRecorder: GenerateBundleContext['hmrTimingRecorder'];
|
|
27
|
+
hmrTimingStartedAt: number;
|
|
28
|
+
isHarmonyAppStyleTarget: boolean;
|
|
29
|
+
isNativeAppStyleTarget: boolean;
|
|
30
|
+
isViteProcessedCssAsset: GenerateBundleContext['isViteProcessedCssAsset'];
|
|
31
|
+
isWebGeneratorTarget: boolean;
|
|
32
|
+
jsAfterCss: boolean;
|
|
33
|
+
jsTaskFactories: Array<() => Promise<void>>;
|
|
34
|
+
lastCssResultByFile: Map<string, string>;
|
|
35
|
+
lastCssSourceHashByFile: Map<string, string>;
|
|
36
|
+
linkedByEntry: Map<string, Set<string>> | undefined;
|
|
37
|
+
markCssAssetProcessed: GenerateBundleContext['markCssAssetProcessed'];
|
|
38
|
+
metrics: BundleMetrics;
|
|
39
|
+
onEnd: GenerateBundleContext['opts']['onEnd'];
|
|
40
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
41
|
+
opts: GenerateBundleContext['opts'];
|
|
42
|
+
outDir: string;
|
|
43
|
+
pendingLinkedUpdates: Array<() => void>;
|
|
44
|
+
pruneViteCssCaches: GenerateBundleContext['pruneViteCssCaches'];
|
|
45
|
+
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
46
|
+
recordTimingDetail: (name: string, startedAt: number) => void;
|
|
47
|
+
recordViteProcessedCssAssetResult: GenerateBundleContext['recordViteProcessedCssAssetResult'];
|
|
48
|
+
rootDir: string;
|
|
49
|
+
runtime: Set<string>;
|
|
50
|
+
runtimeState: GenerateBundleContext['runtimeState'];
|
|
51
|
+
shouldPreserveAppCssExtension: boolean;
|
|
52
|
+
snapshot: BundleSnapshot;
|
|
53
|
+
sourceCandidates: Set<string>;
|
|
54
|
+
sourceRoot: string | undefined;
|
|
55
|
+
state: BundleBuildState;
|
|
56
|
+
styleHandler: GenerateBundleContext['opts']['styleHandler'];
|
|
57
|
+
tasks: Promise<void>[];
|
|
58
|
+
timingDetails: Record<string, number>;
|
|
59
|
+
transformRuntime: Set<string>;
|
|
60
|
+
transformWebTargetCss?: ((css: string, file: string) => string) | undefined;
|
|
61
|
+
useIncrementalMode: boolean;
|
|
62
|
+
}
|
|
63
|
+
export declare function finalizeWebviewCssCompat(bundle: Record<string, OutputAsset | OutputChunk>, options: Pick<FinalizeGenerateBundleOptions, 'debug' | 'onUpdate' | 'opts' | 'recordCssAssetResult'>): number;
|
|
64
|
+
export declare function normalizeRootMiniProgramImportShellAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: Pick<GenerateBundleContext['opts'], 'cssMatcher'> & {
|
|
65
|
+
debug: GenerateBundleContext['debug'];
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
68
|
+
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
69
|
+
}): number;
|
|
@@ -1,70 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../shared/framework-strategy';
|
|
4
|
-
import type { BundleMetrics } from './metrics';
|
|
5
|
-
import type { GenerateBundleContext } from './types';
|
|
6
|
-
interface FinalizeGenerateBundleOptions {
|
|
7
|
-
activeProcessCacheKeys: Set<string>;
|
|
8
|
-
activeProcessHashKeys: Set<string | number>;
|
|
9
|
-
activeViteCssCacheFiles: Set<string>;
|
|
10
|
-
bundle: Record<string, OutputAsset | OutputChunk>;
|
|
11
|
-
bundleFiles: string[];
|
|
12
|
-
cache: GenerateBundleContext['opts']['cache'];
|
|
13
|
-
cssTaskFactories: Array<() => Promise<void>>;
|
|
14
|
-
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
15
|
-
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
16
|
-
debug: GenerateBundleContext['debug'];
|
|
17
|
-
defaultStyleOutputExtension: string;
|
|
18
|
-
formatIteration: number;
|
|
19
|
-
generatorCandidateSignature: string;
|
|
20
|
-
generatorRuntime: Set<string>;
|
|
21
|
-
getCssHandlerOptions: (file: string) => ReturnType<ReturnType<typeof import('./css-handler-options').createCssHandlerOptionsCache>['getCssHandlerOptions']>;
|
|
22
|
-
getSourceCandidateSourcesForEntries: GenerateBundleContext['getSourceCandidateSourcesForEntries'];
|
|
23
|
-
getSourceCandidatesForEntries: GenerateBundleContext['getSourceCandidatesForEntries'];
|
|
24
|
-
getViteCssCacheStats: GenerateBundleContext['getViteCssCacheStats'];
|
|
25
|
-
getViteProcessedCssAssetResults: GenerateBundleContext['getViteProcessedCssAssetResults'];
|
|
26
|
-
hmrTimingRecorder: GenerateBundleContext['hmrTimingRecorder'];
|
|
27
|
-
hmrTimingStartedAt: number;
|
|
28
|
-
isHarmonyAppStyleTarget: boolean;
|
|
29
|
-
isNativeAppStyleTarget: boolean;
|
|
30
|
-
isViteProcessedCssAsset: GenerateBundleContext['isViteProcessedCssAsset'];
|
|
31
|
-
isWebGeneratorTarget: boolean;
|
|
32
|
-
jsAfterCss: boolean;
|
|
33
|
-
jsTaskFactories: Array<() => Promise<void>>;
|
|
34
|
-
lastCssResultByFile: Map<string, string>;
|
|
35
|
-
lastCssSourceHashByFile: Map<string, string>;
|
|
36
|
-
linkedByEntry: Map<string, Set<string>> | undefined;
|
|
37
|
-
markCssAssetProcessed: GenerateBundleContext['markCssAssetProcessed'];
|
|
38
|
-
metrics: BundleMetrics;
|
|
39
|
-
onEnd: GenerateBundleContext['opts']['onEnd'];
|
|
40
|
-
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
41
|
-
opts: GenerateBundleContext['opts'];
|
|
42
|
-
outDir: string;
|
|
43
|
-
pendingLinkedUpdates: Array<() => void>;
|
|
44
|
-
pruneViteCssCaches: GenerateBundleContext['pruneViteCssCaches'];
|
|
45
|
-
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
46
|
-
recordTimingDetail: (name: string, startedAt: number) => void;
|
|
47
|
-
recordViteProcessedCssAssetResult: GenerateBundleContext['recordViteProcessedCssAssetResult'];
|
|
48
|
-
rootDir: string;
|
|
49
|
-
runtime: Set<string>;
|
|
50
|
-
runtimeState: GenerateBundleContext['runtimeState'];
|
|
51
|
-
shouldPreserveAppCssExtension: boolean;
|
|
52
|
-
snapshot: BundleSnapshot;
|
|
53
|
-
sourceCandidates: Set<string>;
|
|
54
|
-
sourceRoot: string | undefined;
|
|
55
|
-
state: BundleBuildState;
|
|
56
|
-
styleHandler: GenerateBundleContext['opts']['styleHandler'];
|
|
57
|
-
tasks: Promise<void>[];
|
|
58
|
-
timingDetails: Record<string, number>;
|
|
59
|
-
transformRuntime: Set<string>;
|
|
60
|
-
transformWebTargetCss?: ((css: string, file: string) => string) | undefined;
|
|
61
|
-
useIncrementalMode: boolean;
|
|
62
|
-
}
|
|
63
|
-
export declare function normalizeRootMiniProgramImportShellAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: Pick<GenerateBundleContext['opts'], 'cssMatcher'> & {
|
|
64
|
-
debug: GenerateBundleContext['debug'];
|
|
65
|
-
enabled: boolean;
|
|
66
|
-
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
67
|
-
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
68
|
-
}): number;
|
|
69
|
-
export declare function finalizeGenerateBundle(options: FinalizeGenerateBundleOptions): Promise<void>;
|
|
70
|
-
export {};
|
|
1
|
+
export { finalizeGenerateBundle } from './finalize/bundle';
|
|
2
|
+
export { normalizeRootMiniProgramImportShellAssets } from './finalize/root-import-shell';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { normalizeBundleFileNameKeysForTest } from './generate-bundle/bundle-file-names';
|
|
2
|
+
import { resolveMiniProgramStyleOutputExtension as resolveMiniProgramStyleOutputExtension2, resolveReplayCssOutputFile as resolveReplayCssOutputFile2, resolveReplayCssOutputFileFromSourceRoot, resolveViteCssPipelineOutputFile as resolveViteCssPipelineOutputFile2, resolveViteCssPipelineOutputFileFromSourceFile } from './generate-bundle/css-output';
|
|
3
|
+
import { resolveRememberedCssSourceForTest } from './generate-bundle/remembered-css';
|
|
4
|
+
import { shouldKeepRootMiniProgramStyleAsImportShell as shouldKeepRootMiniProgramStyleAsImportShell2, shouldMoveRootMiniProgramStyleToImportShellOrigin as shouldMoveRootMiniProgramStyleToImportShellOrigin2 } from './generate-bundle/root-style-output';
|
|
5
|
+
declare function createGenerateBundleHook(context: any): any;
|
|
6
|
+
export { createGenerateBundleHook, normalizeBundleFileNameKeysForTest, resolveMiniProgramStyleOutputExtension2 as resolveMiniProgramStyleOutputExtension, resolveRememberedCssSourceForTest, resolveReplayCssOutputFile2 as resolveReplayCssOutputFile, resolveReplayCssOutputFileFromSourceRoot, resolveViteCssPipelineOutputFile2 as resolveViteCssPipelineOutputFile, resolveViteCssPipelineOutputFileFromSourceFile, shouldKeepRootMiniProgramStyleAsImportShell2 as shouldKeepRootMiniProgramStyleAsImportShell, shouldMoveRootMiniProgramStyleToImportShellOrigin2 as shouldMoveRootMiniProgramStyleToImportShellOrigin };
|
|
@@ -5,4 +5,4 @@ export { resolveMiniProgramStyleOutputExtension, resolveReplayCssOutputFile, res
|
|
|
5
5
|
export { resolveRememberedCssSourceForTest } from './generate-bundle/remembered-css';
|
|
6
6
|
export { shouldKeepRootMiniProgramStyleAsImportShell, shouldMoveRootMiniProgramStyleToImportShellOrigin } from './generate-bundle/root-style-output';
|
|
7
7
|
export type { GenerateBundleContext, GenerateBundleThis, RememberedCssSource } from './generate-bundle/types';
|
|
8
|
-
export declare function createGenerateBundleHook(context: GenerateBundleContext): (this: GenerateBundleThis,
|
|
8
|
+
export declare function createGenerateBundleHook(context: GenerateBundleContext): (this: GenerateBundleThis, options: unknown, bundle: Record<string, OutputAsset | OutputChunk>) => Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OutputAsset, OutputBundle } from 'rollup';
|
|
2
|
+
import type { CollectViteProcessedCssAssetOptions } from './markers-imports';
|
|
3
|
+
export declare function restoreCssImportAtRules(source: string, filtered: string, file?: string): string;
|
|
4
|
+
export declare function removeCommentOnlyAtRules(css: string): string;
|
|
5
|
+
export declare function collectImportedBundleCssSources(bundle: OutputBundle, importedStyleFiles: Set<string>): string[];
|
|
6
|
+
export declare function collectBundleAssetFiles(bundle: OutputBundle): Set<string>;
|
|
7
|
+
export declare function resolveConfiguredCssEntryRootInjectionTarget(bundle: OutputBundle, options: Pick<CollectViteProcessedCssAssetOptions, 'cssPipelineStrategy' | 'createCssPipelineContext' | 'opts'>, sourceFile: string | undefined, outputFile: string): string | undefined;
|
|
8
|
+
export declare function findBundleAssetByOutputFile(bundle: OutputBundle, file: string): OutputAsset | undefined;
|
|
9
|
+
export declare function isCssImportOnlyBundleAsset(bundle: OutputBundle, file: string, css: string): boolean;
|
|
10
|
+
export declare function isCoveredViteGeneratedSourceAsset(file: string, existingAssetFiles: Set<string>, resolveViteProcessedCssOutputFile: ((file: string) => string | undefined) | undefined): boolean;
|
|
11
|
+
export declare function resolveViteGeneratedCssMarkerOutputFile(file: string, markerFile: string | undefined, existingAssetFiles: Set<string>, resolveViteProcessedCssOutputFile: ((file: string) => string | undefined) | undefined): string;
|
|
12
|
+
export declare function isSourceRootPrefixedOutputFile(file: string, outputFile: string): boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OutputBundle } from 'rollup';
|
|
2
|
+
import type { CollectViteProcessedCssAssetOptions, InjectViteProcessedCssAssetOptions } from './markers-imports';
|
|
3
|
+
export declare function collectViteProcessedCssAssetResults(bundle: OutputBundle, options: CollectViteProcessedCssAssetOptions): number;
|
|
4
|
+
export declare function injectViteProcessedCssIntoMainCssAssets(bundle: OutputBundle, options: InjectViteProcessedCssAssetOptions): number;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { OutputBundle } from 'rollup';
|
|
2
|
+
import type { CssAssetMarkerMatcher, CssAssetResultRecorder } from './markers-imports';
|
|
3
|
+
import { postcss } from '@weapp-tailwindcss/postcss';
|
|
4
|
+
export declare function normalizeCssSignatureValue(value: string): string;
|
|
5
|
+
export declare function collectRootScopedComparableCssCoverage(cssSources: string[]): {
|
|
6
|
+
rules: Set<string>;
|
|
7
|
+
atRules: Set<string>;
|
|
8
|
+
declarationsBySelector: Map<string, Set<string>>;
|
|
9
|
+
normalizedRuleCss: Set<string>;
|
|
10
|
+
};
|
|
11
|
+
export type ComparableCssCoverage = ReturnType<typeof collectRootScopedComparableCssCoverage>;
|
|
12
|
+
export declare function prepareImportedCssCoverage(importedCssSources: string[]): {
|
|
13
|
+
coverage: {
|
|
14
|
+
rules: Set<string>;
|
|
15
|
+
atRules: Set<string>;
|
|
16
|
+
declarationsBySelector: Map<string, Set<string>>;
|
|
17
|
+
normalizedRuleCss: Set<string>;
|
|
18
|
+
};
|
|
19
|
+
sources: string[];
|
|
20
|
+
} | undefined;
|
|
21
|
+
export declare function isRuleCoveredByRootCss(rule: postcss.Rule, coverage: ReturnType<typeof collectRootScopedComparableCssCoverage>): boolean;
|
|
22
|
+
export declare function removeScopedTailwindPreflightCss(css: string): string;
|
|
23
|
+
export declare function collectSingleViteGeneratedCssMarkerFile(rawSource: string): string | undefined;
|
|
24
|
+
export declare function shouldFilterRootGeneratedCssMarkerForScopedAsset(targetFile: string, markerFile: string, resolveViteProcessedCssOutputFile: ((file: string) => string | undefined) | undefined): boolean;
|
|
25
|
+
export declare function removeCssCoveredByRootStyleBundleSources(bundle: OutputBundle, file: string, css: string): string;
|
|
26
|
+
export declare function removeCssCoveredByRootStyleAssets(bundle: OutputBundle, options: {
|
|
27
|
+
cssMatcher: (file: string) => boolean;
|
|
28
|
+
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
29
|
+
includeTailwindGeneratedCssAssets?: boolean | undefined;
|
|
30
|
+
isViteProcessedCssAsset?: CssAssetMarkerMatcher | undefined;
|
|
31
|
+
onUpdate?: ((file: string, original: string, generated: string) => void) | undefined;
|
|
32
|
+
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
33
|
+
subpackageRoots?: Set<string> | undefined;
|
|
34
|
+
}): number;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { OutputBundle } from 'rollup';
|
|
2
|
+
import type { ComparableCssCoverage } from './coverage';
|
|
3
|
+
import type { InjectViteProcessedCssAssetOptions } from './markers-imports';
|
|
4
|
+
import type { InternalUserDefinedOptions } from '../../../types';
|
|
5
|
+
export { isMiniProgramStyleOutputFile, isRootStyleOutputFile } from './style-files';
|
|
6
|
+
export declare function shouldInjectViteProcessedCssResult(opts: InternalUserDefinedOptions, targetFile: string, sourceFile: string, options: {
|
|
7
|
+
injectIntoMain?: boolean | undefined;
|
|
8
|
+
outputFile?: string | undefined;
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function shouldReplayViteProcessedCssIntoMainCss(opts: InternalUserDefinedOptions, file: string, sourceFile: string | undefined, outputFile: string, subpackageRoots: Set<string> | undefined): boolean;
|
|
11
|
+
export declare function shouldPreserveMiniProgramImportShell(options: Pick<InjectViteProcessedCssAssetOptions, 'cssPipelineStrategy' | 'createCssPipelineContext' | 'opts'>, bundle: OutputBundle, file: string, css: string): boolean;
|
|
12
|
+
export declare function resolvePreservedImportShellInjectionTarget(options: Pick<InjectViteProcessedCssAssetOptions, 'cssPipelineStrategy' | 'createCssPipelineContext'>, bundle: OutputBundle, file: string, css: string): string | undefined;
|
|
13
|
+
export declare function shouldUseCssAssetAsMainInjectionTarget(opts: InternalUserDefinedOptions, file: string, records: Array<{
|
|
14
|
+
injectIntoMain?: boolean | undefined;
|
|
15
|
+
outputFile?: string | undefined;
|
|
16
|
+
}>, options: Pick<InjectViteProcessedCssAssetOptions, 'cssPipelineStrategy' | 'createCssPipelineContext'>, bundle: OutputBundle): boolean;
|
|
17
|
+
export declare function isViteProcessedCssResultImported(record: {
|
|
18
|
+
file: string;
|
|
19
|
+
outputFile?: string | undefined;
|
|
20
|
+
}, importedStyleFiles: Set<string>): boolean;
|
|
21
|
+
export declare function isViteProcessedCssResultCoveredByImportedBundleAsset(record: {
|
|
22
|
+
file: string;
|
|
23
|
+
outputFile?: string | undefined;
|
|
24
|
+
}, importedStyleFiles: Set<string>, assetFiles: Set<string>): boolean;
|
|
25
|
+
export declare function removeCoveredInjectedSourceAssets(bundle: OutputBundle, targetFile: string, targetCss: string, records: Array<{
|
|
26
|
+
file: string;
|
|
27
|
+
css: string;
|
|
28
|
+
injectIntoMain?: boolean | undefined;
|
|
29
|
+
outputFile?: string | undefined;
|
|
30
|
+
}>, options: Pick<InjectViteProcessedCssAssetOptions, 'shouldRemoveInjectedSourceAsset' | 'debug'>): number;
|
|
31
|
+
export declare function removeCssCoveredByImportedViteResults(css: string, importedCssSources: string[], prepared?: {
|
|
32
|
+
coverage: {
|
|
33
|
+
rules: Set<string>;
|
|
34
|
+
atRules: Set<string>;
|
|
35
|
+
declarationsBySelector: Map<string, Set<string>>;
|
|
36
|
+
normalizedRuleCss: Set<string>;
|
|
37
|
+
};
|
|
38
|
+
sources: string[];
|
|
39
|
+
} | undefined): string;
|
|
40
|
+
export declare function removeCssRulesCoveredBySources(css: string, sources: string[], options?: {
|
|
41
|
+
exactOnly?: boolean | undefined;
|
|
42
|
+
}, preparedCoverage?: ComparableCssCoverage | undefined): string;
|
|
@@ -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;
|
|
@@ -7,6 +7,7 @@ interface ViteCssGenerationOptions {
|
|
|
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;
|
|
@@ -1,11 +1,11 @@
|
|
|
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;
|
|
@@ -14,7 +14,7 @@ export interface ViteFrameworkBranchContext {
|
|
|
14
14
|
frameworkName: ViteFrameworkName;
|
|
15
15
|
adaptWatchCssBeforeFrameworkCache?: boolean;
|
|
16
16
|
createExtraPlugins?: (context: ViteFrameworkExtraPluginContext) => Plugin[];
|
|
17
|
-
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy
|
|
17
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy;
|
|
18
18
|
getExtraPluginPlatform?: () => ViteFrameworkExtraPluginPlatform;
|
|
19
19
|
styleInjectorDelegate: ViteStyleInjectorDelegateFactory;
|
|
20
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;
|