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,10 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { InternalUserDefinedOptions } from '../../../../types';
|
|
3
|
+
export declare function transformGeneratorUserCss(source: string, options: {
|
|
4
|
+
generatorTarget: string;
|
|
5
|
+
generatorStyleOptions: Partial<IStyleHandlerOptions>;
|
|
6
|
+
cssUserHandlerOptions: IStyleHandlerOptions;
|
|
7
|
+
styleHandler: InternalUserDefinedOptions['styleHandler'];
|
|
8
|
+
importFallback: boolean;
|
|
9
|
+
processed?: boolean | undefined;
|
|
10
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { postcss } from '@weapp-tailwindcss/postcss';
|
|
2
|
+
export declare function splitUserCssLayerBlocks(source: string): {
|
|
3
|
+
layer: string;
|
|
4
|
+
rest: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function hasUserCssLayerBlocks(source: string): boolean;
|
|
7
|
+
export declare function extractGeneratedCssForUserLayerSelectors(css: string, userLayerSource: string): {
|
|
8
|
+
layer: string;
|
|
9
|
+
rest: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function normalizeGeneratedSelector(selector: string): string;
|
|
12
|
+
export declare function collectApplyOnlySourceSelectors(source: string): Set<string>;
|
|
13
|
+
export declare function hasOnlyApplyBackedSourceRules(source: string): boolean;
|
|
14
|
+
export declare function removeCssComments(css: string): string;
|
|
15
|
+
export declare function isEmptyCustomVariantBlock(rule: postcss.AtRule): boolean;
|
|
@@ -1,33 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export declare function removeMiniProgramHoverSelectors(source: string, enabled?: boolean | undefined): string;
|
|
7
|
-
export declare function stripTailwindSourceMediaFragments(source: string): string;
|
|
8
|
-
export declare function stripUnmatchedTailwindSourceMediaCloseFragments(source: string): string;
|
|
9
|
-
export declare function splitUserCssLayerBlocks(source: string): {
|
|
10
|
-
layer: string;
|
|
11
|
-
rest: string;
|
|
12
|
-
};
|
|
13
|
-
export declare function hasUserCssLayerBlocks(source: string): boolean;
|
|
14
|
-
export declare function extractGeneratedCssForUserLayerSelectors(css: string, userLayerSource: string): {
|
|
15
|
-
layer: string;
|
|
16
|
-
rest: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function normalizeEmptyTailwindCustomVariants(css: string): string;
|
|
19
|
-
export declare function filterApplyOnlyGeneratedCss(css: string, source: string, options?: {
|
|
20
|
-
preserveVariables?: boolean | undefined;
|
|
21
|
-
}): string;
|
|
22
|
-
export declare function shouldFilterApplyOnlyGeneratedCss(_majorVersion: number | undefined, target: string, source: string, options: {
|
|
23
|
-
hasGeneratedCss: boolean;
|
|
24
|
-
hasGeneratedMarkers: boolean;
|
|
25
|
-
}): boolean;
|
|
26
|
-
export declare function transformGeneratorUserCss(source: string, options: {
|
|
27
|
-
generatorTarget: string;
|
|
28
|
-
generatorStyleOptions: Partial<IStyleHandlerOptions>;
|
|
29
|
-
cssUserHandlerOptions: IStyleHandlerOptions;
|
|
30
|
-
styleHandler: InternalUserDefinedOptions['styleHandler'];
|
|
31
|
-
importFallback: boolean;
|
|
32
|
-
processed?: boolean | undefined;
|
|
33
|
-
}): Promise<string>;
|
|
1
|
+
export { filterApplyOnlyGeneratedCss, normalizeEmptyTailwindCustomVariants, shouldFilterApplyOnlyGeneratedCss } from './user-css/apply-only';
|
|
2
|
+
export { removeTailwindV4GeneratedUserCssArtifacts } from './user-css/generated-cleanup';
|
|
3
|
+
export { isCommentOnlyCss, removeMiniProgramHoverSelectors, removeTailwindV4GeneratorAtRules, stripTailwindSourceMediaFragments, stripUnmatchedTailwindSourceMediaCloseFragments } from './user-css/source-fragments';
|
|
4
|
+
export { transformGeneratorUserCss } from './user-css/transform';
|
|
5
|
+
export { extractGeneratedCssForUserLayerSelectors, hasUserCssLayerBlocks, splitUserCssLayerBlocks } from './user-css/user-layers';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { GenerateCssByGeneratorOptions, GenerateCssByGeneratorResult } from './generator-css/types';
|
|
2
1
|
export { hasTailwindSourceDirectives, normalizeTailwindSourceForGenerator, removeTailwindSourceDirectives, resolveCssEntrySource, } from './generator-css/directives';
|
|
3
2
|
export { removeTailwindApplyRules, } from './generator-css/legacy-compat';
|
|
4
3
|
export { inheritLegacyUnitConvertedDeclarations, } from './generator-css/legacy-units';
|
|
5
4
|
export { isPureLocalCssImportWrapper, } from './generator-css/local-imports';
|
|
6
5
|
export { createCssAppend, hasTailwindGeneratedCss, hasTailwindGeneratedCssMarkers, removeTailwindGeneratedCssByBanner, splitGeneratorPlaceholderCssBySourceOrder, splitTailwindGeneratedCssByBanner, splitTailwindV4GeneratedCss, splitTailwindV4GeneratedCssBySourceOrder, stripGeneratorPlaceholderMarkers, stripTailwindBanner, stripTailwindBanners, } from './generator-css/markers';
|
|
6
|
+
export { generateCssByGenerator } from './generator-css/pipeline';
|
|
7
7
|
export { resolveGeneratorSource, } from './generator-css/source-resolver';
|
|
8
8
|
export type { GenerateCssByGeneratorOptions, GenerateCssByGeneratorResult, } from './generator-css/types';
|
|
9
9
|
export { validateCandidatesByGenerator, } from './generator-css/validate';
|
|
10
|
-
export declare function generateCssByGenerator(options: GenerateCssByGeneratorOptions): Promise<GenerateCssByGeneratorResult | undefined>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { GenerateCssByGeneratorOptions, GenerateCssByGeneratorResult } from './generator-css';
|
|
2
|
+
import type { InternalUserDefinedOptions } from '../../types';
|
|
2
3
|
export interface TailwindV4GenerationCoreInput extends GenerateCssByGeneratorOptions {
|
|
4
|
+
frameworkPostcssOwner?: InternalUserDefinedOptions | undefined;
|
|
5
|
+
frameworkPostcssStage?: 'complete' | 'pending' | undefined;
|
|
3
6
|
outputFile?: string | undefined;
|
|
4
7
|
sourceCandidates?: Set<string> | undefined;
|
|
5
8
|
}
|
|
@@ -32,6 +32,7 @@ export interface BundleBuildState {
|
|
|
32
32
|
runtimeAffectingHashByFile: Map<string, string>;
|
|
33
33
|
linkedByEntry: Map<string, Set<string>>;
|
|
34
34
|
dependentsByLinkedFile: Map<string, Set<string>>;
|
|
35
|
+
bundleMarkupCandidatesByFile: Map<string, Set<string>>;
|
|
35
36
|
generatorCandidateSignature?: string | undefined;
|
|
36
37
|
}
|
|
37
38
|
interface UpdateBundleBuildStateOptions {
|
|
@@ -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,20 @@
|
|
|
1
|
+
import type { BundleSnapshot } from '../bundle-state';
|
|
2
|
+
import type { SourceCandidateFilterOptions } from '../source-candidates';
|
|
3
|
+
import type { createTransformFilter } from './transform-filter';
|
|
4
|
+
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
5
|
+
interface CollectBundleMarkupCandidatesOptions {
|
|
6
|
+
extractSourceCandidates?: ((file: string, source: string) => Promise<Set<string>>) | undefined;
|
|
7
|
+
previousCandidatesByFile?: ReadonlyMap<string, Set<string>> | undefined;
|
|
8
|
+
preserveMissingFiles?: boolean | undefined;
|
|
9
|
+
resolveSourceCandidateFile: (file: string) => string | undefined;
|
|
10
|
+
rootDir: string;
|
|
11
|
+
snapshot: BundleSnapshot;
|
|
12
|
+
transformFilter: ReturnType<typeof createTransformFilter>;
|
|
13
|
+
}
|
|
14
|
+
export interface BundleMarkupCandidateCollection {
|
|
15
|
+
candidatesByFile: Map<string, Set<string>>;
|
|
16
|
+
values: Set<string>;
|
|
17
|
+
valuesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>;
|
|
18
|
+
}
|
|
19
|
+
export declare function collectBundleMarkupCandidates(options: CollectBundleMarkupCandidatesOptions): Promise<BundleMarkupCandidateCollection>;
|
|
20
|
+
export {};
|
|
@@ -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';
|
|
@@ -55,5 +55,6 @@ interface ProcessRememberedCssReplayOptions {
|
|
|
55
55
|
useIncrementalMode: boolean;
|
|
56
56
|
activeViteCssCacheFiles: Set<string>;
|
|
57
57
|
}
|
|
58
|
+
export declare function shouldSkipRawRememberedCssSource(rawSource: string, sourceFile: string): boolean;
|
|
58
59
|
export declare function processRememberedCssReplay(options: ProcessRememberedCssReplayOptions): Promise<void>;
|
|
59
60
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OutputChunk } from 'rollup';
|
|
2
2
|
import type { BundleSnapshot } from '../bundle-state';
|
|
3
3
|
import type { RememberedCssSource } from './types';
|
|
4
|
+
export declare function isSfcStyleSourceFile(file: string): boolean;
|
|
4
5
|
export interface SfcStyleBlock {
|
|
5
6
|
attrs: string;
|
|
6
7
|
index: number;
|
|
@@ -10,7 +11,7 @@ export interface SfcStyleBlock {
|
|
|
10
11
|
export declare function extractSfcStyleBlocks(source: string): SfcStyleBlock[];
|
|
11
12
|
export declare function extractSfcStyleSources(source: string): string[];
|
|
12
13
|
export declare function hasSfcStyleSources(source: string): boolean;
|
|
13
|
-
export declare function resolveSfcStyleRequestFromKnownSource(sourceFile: string, sfcSource: string | undefined, styleSource: string): string;
|
|
14
|
+
export declare function resolveSfcStyleRequestFromKnownSource(sourceFile: string, sfcSource: string | undefined, styleSource: string, currentRequest?: string): string;
|
|
14
15
|
export declare function hasTailwindGenerationSource(source: string, options?: {
|
|
15
16
|
allowRootDirectives?: boolean | undefined;
|
|
16
17
|
}): boolean;
|
|
@@ -6,4 +6,5 @@ export interface ResolveCurrentSourceCandidateSourceOptions {
|
|
|
6
6
|
rootDir: string;
|
|
7
7
|
sourceRoot?: string | undefined;
|
|
8
8
|
}
|
|
9
|
+
export declare function resolveCurrentSourceCandidateFile(options: ResolveCurrentSourceCandidateSourceOptions): string | undefined;
|
|
9
10
|
export declare function resolveCurrentSourceCandidateSource(options: ResolveCurrentSourceCandidateSourceOptions): string | undefined;
|
|
@@ -7,6 +7,10 @@ import type { SourceCandidateFilterOptions } from '../source-candidates';
|
|
|
7
7
|
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
8
8
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
9
9
|
export interface GenerateBundleContext {
|
|
10
|
+
processMarkupAndScripts?: boolean | undefined;
|
|
11
|
+
processStyles?: boolean | undefined;
|
|
12
|
+
shouldProcessBundle?: (() => boolean) | undefined;
|
|
13
|
+
shouldProcessStyles?: (() => boolean) | undefined;
|
|
10
14
|
opts: InternalUserDefinedOptions;
|
|
11
15
|
runtimeState: {
|
|
12
16
|
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
@@ -42,6 +46,7 @@ export interface GenerateBundleContext {
|
|
|
42
46
|
getSourceCandidates?: () => Set<string>;
|
|
43
47
|
getSourceCandidateSource?: (file: string) => string | undefined;
|
|
44
48
|
getSourceCandidateSources?: () => Iterable<[string, string]>;
|
|
49
|
+
extractSourceCandidates?: (file: string, source: string) => Promise<Set<string>>;
|
|
45
50
|
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>) | undefined;
|
|
46
51
|
getSourceCandidateSourcesForEntries?: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined;
|
|
47
52
|
waitForSourceCandidateSyncs?: () => Promise<void>;
|
|
@@ -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;
|