weapp-tailwindcss 5.1.0 → 5.1.2
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/README.en.md +2 -0
- package/README.md +2 -0
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +6 -14
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/vite/css-memory.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +39 -0
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/html-processing.d.ts +26 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/runtime-linked-source-memory.d.ts +25 -0
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/tailwind-v4-css-source.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/transform-filter.d.ts +15 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -2
- package/dist/bundlers/vite/plugin-cache.d.ts +15 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +2 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +34 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/js-module-graph.d.ts +37 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +199 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-refresh.d.ts +11 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -0
- package/dist/cli.js +15 -8
- package/dist/cli.mjs +15 -8
- package/dist/context/style-options.d.ts +1 -0
- package/dist/{context-Mbzkek1q.mjs → context-C-r8ki7x.mjs} +15 -10
- package/dist/{context-BHxLe743.js → context-CH4HFZP2.js} +20 -9
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro/index.d.ts +3 -7
- package/dist/{defaults-ZElj1zKc.mjs → defaults-BhE26nSw.mjs} +7 -3
- package/dist/{defaults-CVcKbXBG.js → defaults-CmFBmxsr.js} +7 -3
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/generator/options.d.ts +3 -1
- package/dist/generator/types.d.ts +1 -1
- package/dist/{generator-9rUz4Hcb.js → generator-B6pUjNdD.js} +3 -1
- package/dist/{generator-Dc4qaPmT.mjs → generator-BsPIaLtV.mjs} +3 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-B_sdP6dx.js → gulp-BBCeA7ky.js} +11 -9
- package/dist/{gulp-uM36oIJs.mjs → gulp-CTdcASq8.mjs} +11 -9
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-BXMLsF4b.mjs → hmr-timing-BRx-KnBh.mjs} +128 -86
- package/dist/{hmr-timing-CogqkFaF.js → hmr-timing-Da1eI8S0.js} +138 -84
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +2 -2
- package/dist/postcss.mjs +2 -2
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/{source-candidate-scan-signature-2ybpptAK.js → source-candidate-scan-signature-BO6JSskQ.js} +3 -3
- package/dist/{source-candidate-scan-signature-Cvb5z1ha.mjs → source-candidate-scan-signature-Dugfplms.mjs} +3 -3
- package/dist/tailwindcss/runtime-types.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +5 -14
- package/dist/tailwindcss/v4-engine/types.d.ts +10 -2
- package/dist/{tailwindcss-wyUHrfil.mjs → tailwindcss-B5mRo0-M.mjs} +12 -7
- package/dist/{tailwindcss-DHIYcqXT.js → tailwindcss-dbrbY4cd.js} +11 -6
- package/dist/{transform-CQVOgmzM.js → transform-BLleu_bA.js} +1 -1
- package/dist/{transform-tExdt40m.mjs → transform-DeqFRp1D.mjs} +1 -1
- package/dist/types/user-defined-options/matcher.d.ts +7 -0
- package/dist/{v4-engine-CF9zt4Cw.mjs → v4-engine-C3qSwQ-e.mjs} +7 -27
- package/dist/{v4-engine-D4ubP7N5.js → v4-engine-ON_oSLfO.js} +5 -31
- package/dist/{vite-CPO83EhA.mjs → vite-CXmUiI9f.mjs} +734 -393
- package/dist/{vite-CP0ylSxZ.js → vite-Da4uEG_u.js} +734 -392
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +130 -85
- package/dist/{webpack-BzqhJ8yK.mjs → webpack-CrFZmdo7.mjs} +923 -671
- package/dist/{webpack-Bsek8VhR.js → webpack-Cwqnznng.js} +923 -671
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +3 -3
package/README.en.md
CHANGED
|
@@ -7,3 +7,5 @@ This is the core package that brings Tailwind CSS to mini program ecosystems, ha
|
|
|
7
7
|
## Website
|
|
8
8
|
|
|
9
9
|
For setup guides, configuration references, and framework examples, see the [official weapp-tailwindcss documentation](https://tw.icebreaker.top).
|
|
10
|
+
|
|
11
|
+
For Tailwind CSS 4 projects, the entry CSS must still be imported by the application. Configure `cssEntries` when the plugin needs an explicit hint, but do not treat it as a replacement for importing the CSS entry into the build graph.
|
package/README.md
CHANGED
|
@@ -51,23 +51,15 @@ export declare function shouldUseGeneratorForCurrentCss(_majorVersion: number |
|
|
|
51
51
|
hasGeneratedMarkers: boolean;
|
|
52
52
|
hasSourceDirectives: boolean;
|
|
53
53
|
rawSource: string;
|
|
54
|
-
|
|
54
|
+
runtimeCandidateCount?: number | undefined;
|
|
55
|
+
target?: string | undefined;
|
|
56
|
+
configuredCssSourceCount?: number | undefined;
|
|
57
|
+
}): boolean | undefined;
|
|
55
58
|
export declare function hasGeneratorSourceDirectives(source: string, importFallback: boolean): boolean;
|
|
56
59
|
export declare function createRuntimeWithCurrentCssCandidates(runtime: Set<string>, currentCssCandidates: string[], isolateCurrentCssCandidates: boolean): Set<string>;
|
|
57
60
|
export declare function mergeGeneratorResults(generatedResults: GeneratorResult[]): (import("@/generator").TailwindV4GenerateResult & {
|
|
58
|
-
target: WeappTailwindcssGeneratorTarget;
|
|
59
|
-
rawCss: string;
|
|
60
|
-
}) | {
|
|
61
|
-
css: string;
|
|
61
|
+
target: import("@/generator").WeappTailwindcssGeneratorTarget;
|
|
62
62
|
rawCss: string;
|
|
63
|
-
|
|
64
|
-
incrementalRawCss: string | undefined;
|
|
65
|
-
classSet: Set<string>;
|
|
66
|
-
dependencies: string[];
|
|
67
|
-
sources: import("@tailwindcss-mangle/engine").TailwindV4SourcePattern[];
|
|
68
|
-
target: any;
|
|
69
|
-
root: import("@tailwindcss-mangle/engine").TailwindV4CompiledSourceRoot;
|
|
70
|
-
rawCandidates: Set<string>;
|
|
71
|
-
} | undefined;
|
|
63
|
+
}) | undefined;
|
|
72
64
|
type GeneratorResult = Awaited<ReturnType<ReturnType<typeof createWeappTailwindcssGenerator>['generate']>>;
|
|
73
65
|
export {};
|
|
@@ -12,4 +12,4 @@ export type GeneratorResolvedSource = TailwindResolvedSource & {
|
|
|
12
12
|
__weappTailwindcssMeta?: GeneratorSourceMetadata | undefined;
|
|
13
13
|
};
|
|
14
14
|
export declare function withGeneratorSourceMetadata(source: TailwindResolvedSource, metadata: GeneratorSourceMetadata): GeneratorResolvedSource;
|
|
15
|
-
export declare function withMatchedSourceSideMetadata(source: TailwindResolvedSource, resolvedEntrySource: SourceSideCssEntrySource): import("
|
|
15
|
+
export declare function withMatchedSourceSideMetadata(source: TailwindResolvedSource, resolvedEntrySource: SourceSideCssEntrySource): import("@/generator").TailwindV4ResolvedSource;
|
|
@@ -4,6 +4,6 @@ import type { NormalizedWeappTailwindcssGeneratorOptions, TailwindResolvedSource
|
|
|
4
4
|
export type { GeneratorResolvedSource, GeneratorSourceMetadata } from './source-resolver/metadata';
|
|
5
5
|
export { resolveCssSourceBase } from './source-resolver/postcss-source';
|
|
6
6
|
export type { GeneratorSourceRuntimeState, GeneratorSourceSelectionOptions } from './source-resolver/types';
|
|
7
|
-
export declare function resolveGeneratorSource(_majorVersion: number | undefined, runtimeState: GeneratorSourceRuntimeState, rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions, generatorOptions?: NormalizedWeappTailwindcssGeneratorOptions, selectionOptions?: GeneratorSourceSelectionOptions): Promise<import("
|
|
7
|
+
export declare function resolveGeneratorSource(_majorVersion: number | undefined, runtimeState: GeneratorSourceRuntimeState, rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions, generatorOptions?: NormalizedWeappTailwindcssGeneratorOptions, selectionOptions?: GeneratorSourceSelectionOptions): Promise<import("@/generator").TailwindV4ResolvedSource | undefined>;
|
|
8
8
|
export declare function resolveGeneratorSources(majorVersion: number | undefined, runtimeState: GeneratorSourceRuntimeState, rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions, generatorOptions?: NormalizedWeappTailwindcssGeneratorOptions, selectionOptions?: GeneratorSourceSelectionOptions): Promise<TailwindResolvedSource[]>;
|
|
9
|
-
export declare function resolveGeneratorSourceEntries(source: TailwindResolvedSource, runtimeState?: GeneratorSourceRuntimeState): Promise<
|
|
9
|
+
export declare function resolveGeneratorSourceEntries(source: TailwindResolvedSource, runtimeState?: GeneratorSourceRuntimeState): Promise<import("@/tailwindcss/source-scan").TailwindSourceEntry[] | undefined>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GenerateCssByGeneratorOptions } from './types';
|
|
2
2
|
export interface ValidateCandidatesByGeneratorOptions extends Omit<GenerateCssByGeneratorOptions, 'runtime'> {
|
|
3
3
|
candidates: Set<string>;
|
|
4
|
+
generatedCssSources?: Iterable<string> | undefined;
|
|
4
5
|
skipGenerateFallback?: boolean | undefined;
|
|
5
6
|
}
|
|
6
7
|
export declare function validateCandidatesByGenerator(options: ValidateCandidatesByGeneratorOptions): Promise<Set<string>>;
|
|
@@ -17,6 +17,12 @@ export declare function createViteCssMemory(options: {
|
|
|
17
17
|
size: number;
|
|
18
18
|
};
|
|
19
19
|
rememberedCssSignatureByFile: number;
|
|
20
|
+
knownCssSources: number;
|
|
21
|
+
knownCssSourcesRaw: {
|
|
22
|
+
bytes: number;
|
|
23
|
+
mb: number;
|
|
24
|
+
size: number;
|
|
25
|
+
};
|
|
20
26
|
knownSfcSources: number;
|
|
21
27
|
knownSfcSourcesRaw: {
|
|
22
28
|
bytes: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { OutputAsset } from 'rollup';
|
|
2
2
|
import type { GenerateBundleThis } from './types';
|
|
3
|
-
export declare function createCssAssetEmitter(context: Pick<GenerateBundleThis, 'emitFile'>): (fileName: string, source: string) => OutputAsset;
|
|
3
|
+
export declare function createCssAssetEmitter(context: Pick<GenerateBundleThis, 'emitFile'>): (fileName: string, source: string) => OutputAsset | undefined;
|
|
4
4
|
export declare function resolveAssetSourceFile(asset: OutputAsset, fallbackFile: string): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
export declare function resolveCssBundleOutputFile(options: {
|
|
4
|
+
bundleFiles: string[];
|
|
5
|
+
defaultStyleOutputExtension: string;
|
|
6
|
+
file: string;
|
|
7
|
+
isWebGeneratorTarget: boolean;
|
|
8
|
+
opts: InternalUserDefinedOptions;
|
|
9
|
+
shouldPreserveAppCssExtension: boolean;
|
|
10
|
+
}): string;
|
|
11
|
+
export declare function shouldSkipRawSourceStyleAsset(outputFile: string, file: string, rawSource: string, assetSourceFile?: string, cssMatcher?: ((file: string) => boolean) | undefined): boolean;
|
|
12
|
+
export declare function resolveOutputFileFromMatchedCssSource(options: {
|
|
13
|
+
bundleFiles: string[];
|
|
14
|
+
defaultStyleOutputExtension: string;
|
|
15
|
+
isWebGeneratorTarget: boolean;
|
|
16
|
+
opts: Pick<InternalUserDefinedOptions, 'cssMatcher' | 'platform'>;
|
|
17
|
+
rootDir: string;
|
|
18
|
+
shouldPreserveAppCssExtension: boolean;
|
|
19
|
+
sourceFile: string | undefined;
|
|
20
|
+
sourceRoot?: string | undefined;
|
|
21
|
+
}): string | undefined;
|
|
22
|
+
export declare function createMatchedCssSourceOutputResolver(options: {
|
|
23
|
+
assetSourceFile: string;
|
|
24
|
+
file: string;
|
|
25
|
+
originalFileNames?: string[] | undefined;
|
|
26
|
+
resolveOutputFileFromMatchedCssSource: (sourceFile: string | undefined) => string | undefined;
|
|
27
|
+
}): (sourceFile: string | undefined) => string | undefined;
|
|
28
|
+
export declare function hasViteProcessedCssResultForSource(sourceFile: string, getViteProcessedCssAssetResults?: (() => Iterable<[string, unknown]> | undefined) | undefined): boolean;
|
|
29
|
+
export declare function applyCssResultToBundle(options: {
|
|
30
|
+
assetSourceFile: string;
|
|
31
|
+
bundle: Record<string, OutputAsset | OutputChunk>;
|
|
32
|
+
emitOrReplayCssAsset: (file: string, source: string) => OutputAsset | undefined;
|
|
33
|
+
file: string;
|
|
34
|
+
originalSource: OutputAsset;
|
|
35
|
+
outputFile: string;
|
|
36
|
+
source: string;
|
|
37
|
+
viteProcessedCssAsset: boolean;
|
|
38
|
+
appType: unknown;
|
|
39
|
+
}): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
2
|
import type { GenerateBundleContext } from './types';
|
|
3
|
+
import type { IStyleHandlerOptions } from '../../../types';
|
|
3
4
|
export declare function finalizeMiniProgramCssAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: {
|
|
4
5
|
cssMatcher: GenerateBundleContext['opts']['cssMatcher'];
|
|
5
|
-
getCssHandlerOptions:
|
|
6
|
+
getCssHandlerOptions: (file: string) => IStyleHandlerOptions;
|
|
6
7
|
isWebGeneratorTarget: boolean;
|
|
7
8
|
lastCssResultByFile?: Map<string, string> | undefined;
|
|
8
9
|
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
@@ -26,6 +26,8 @@ interface FinalizeGenerateBundleOptions {
|
|
|
26
26
|
isNativeAppStyleTarget: boolean;
|
|
27
27
|
isViteProcessedCssAsset: GenerateBundleContext['isViteProcessedCssAsset'];
|
|
28
28
|
isWebGeneratorTarget: boolean;
|
|
29
|
+
jsAfterCss: boolean;
|
|
30
|
+
jsTaskFactories: Array<() => Promise<void>>;
|
|
29
31
|
lastCssResultByFile: Map<string, string>;
|
|
30
32
|
lastCssSourceHashByFile: Map<string, string>;
|
|
31
33
|
linkedByEntry: Map<string, Set<string>> | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { OutputAsset } from 'rollup';
|
|
2
|
+
import type { createEmptyMetrics } from './metrics';
|
|
3
|
+
import { processCachedTask } from '../../shared/cache';
|
|
4
|
+
export interface ProcessHtmlBundleEntryOptions {
|
|
5
|
+
cache: Parameters<typeof processCachedTask<string>>[0]['cache'];
|
|
6
|
+
context: {
|
|
7
|
+
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
8
|
+
};
|
|
9
|
+
debug: (message: string, ...args: unknown[]) => void;
|
|
10
|
+
dynamicRetryCandidates: Set<string>;
|
|
11
|
+
file: string;
|
|
12
|
+
metrics: ReturnType<typeof createEmptyMetrics>;
|
|
13
|
+
onUpdate: (file: string, oldVal: string, newVal: string) => void;
|
|
14
|
+
originalEntrySource: string;
|
|
15
|
+
originalSource: OutputAsset;
|
|
16
|
+
rememberProcessCacheKey: (cacheKey: string, hashKey?: string | number) => void;
|
|
17
|
+
resolveCurrentSourceCandidateSource: (file: string) => string | undefined;
|
|
18
|
+
tasks: Promise<void>[];
|
|
19
|
+
templateHandler: (source: string, options: {
|
|
20
|
+
runtimeSet: Set<string>;
|
|
21
|
+
}) => string | Promise<string>;
|
|
22
|
+
timeTask: (name: string, task: () => Promise<void>) => Promise<void>;
|
|
23
|
+
transformRuntime: Set<string>;
|
|
24
|
+
transformRuntimeSignature: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function processHtmlBundleEntry(options: ProcessHtmlBundleEntryOptions): void;
|
|
@@ -22,8 +22,12 @@ interface ProcessJsBundleEntryOptions {
|
|
|
22
22
|
rememberProcessCacheKey: (cacheKey: string, hashKey?: string | number) => void;
|
|
23
23
|
runtimeSignature: string;
|
|
24
24
|
snapshot: BundleSnapshot;
|
|
25
|
+
shouldSkipAstTransform: ((chunk: OutputChunk) => boolean) | undefined;
|
|
26
|
+
slowJsAstWarnMs: number;
|
|
25
27
|
timeTask: (name: string, task: () => Promise<void>) => Promise<void>;
|
|
26
28
|
transformRuntime: Set<string>;
|
|
29
|
+
transformRuntimeSignature: string;
|
|
30
|
+
transformFilterSignature: string;
|
|
27
31
|
uniAppX: GenerateBundleContext['opts']['uniAppX'];
|
|
28
32
|
useIncrementalMode: boolean;
|
|
29
33
|
}
|
|
@@ -18,7 +18,7 @@ interface ProcessRememberedCssReplayOptions {
|
|
|
18
18
|
cssTaskFactories: Array<() => Promise<void>>;
|
|
19
19
|
debug: GenerateBundleContext['debug'];
|
|
20
20
|
defaultStyleOutputExtension: string;
|
|
21
|
-
emitOrReplayCssAsset: (fileName: string, source: string) => OutputAsset;
|
|
21
|
+
emitOrReplayCssAsset: (fileName: string, source: string) => OutputAsset | undefined;
|
|
22
22
|
generatorRuntime: Set<string>;
|
|
23
23
|
getCssHandlerOptions: (file: string) => ReturnType<ReturnType<typeof import('./css-handler-options').createCssHandlerOptionsCache>['getCssHandlerOptions']>;
|
|
24
24
|
getCssUserHandlerOptions: (file: string) => ReturnType<ReturnType<typeof import('./css-handler-options').createCssHandlerOptionsCache>['getCssUserHandlerOptions']>;
|
|
@@ -5,7 +5,7 @@ export declare function createRememberedCssRuntimeSignature(cssRuntimeSignature:
|
|
|
5
5
|
export declare function resolveRememberedCssSourceForTest(sources: Iterable<[string, RememberedCssSource]> | undefined, outputFile: string, file: string, originalSource: OutputAsset, outputRoot: string, sourceRoot: string | undefined): RememberedCssSource | undefined;
|
|
6
6
|
export declare function findRememberedCssSources(sources: Iterable<[string, RememberedCssSource]> | undefined, outputFile: string, file: string, originalSource: OutputAsset, outputRoot: string, sourceRoot: string | undefined): RememberedCssSource[];
|
|
7
7
|
export declare function mergeRememberedCssSources(sources: RememberedCssSource[], outputFile: string): RememberedCssSource | undefined;
|
|
8
|
-
export declare function collectRememberedCssReplayGroups(sources: Iterable<[string, RememberedCssSource]> | undefined, opts: Pick<InternalUserDefinedOptions, 'cssMatcher'>, rootDir: string, isWebGeneratorTarget: boolean, preserveCssExtension: boolean, sourceRoot?: string | undefined, styleOutputExtension?: string | undefined, styleOutputFiles?: Iterable<string> | undefined): Map<string, {
|
|
8
|
+
export declare function collectRememberedCssReplayGroups(sources: Iterable<[string, RememberedCssSource]> | undefined, opts: Pick<InternalUserDefinedOptions, 'cssMatcher' | 'platform'>, rootDir: string, isWebGeneratorTarget: boolean, preserveCssExtension: boolean, sourceRoot?: string | undefined, styleOutputExtension?: string | undefined, styleOutputFiles?: Iterable<string> | undefined): Map<string, {
|
|
9
9
|
key: string;
|
|
10
10
|
remembered: RememberedCssSource;
|
|
11
11
|
}[]>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isRootMiniProgramStyleOutputFile(file: string): boolean;
|
|
2
|
+
export declare function createRelativeCssImportRequest(targetFile: string, importedFile: string): string;
|
|
3
|
+
export declare function createCssImportShell(targetFile: string, importedFile: string): string;
|
|
4
|
+
export declare function createRootMiniProgramOriginStyleOutputFile(file: string): string;
|
|
5
|
+
export declare function shouldKeepRootMiniProgramStyleAsImportShell(appType: unknown): appType is "uni-app-x" | "taro" | "uni-app-vite";
|
|
6
|
+
export declare function shouldMoveRootMiniProgramStyleToImportShellOrigin(appType: unknown): appType is "taro";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BundleSnapshot } from '../bundle-state';
|
|
2
|
+
import type { RememberedCssSource } from './types';
|
|
3
|
+
import type { InternalUserDefinedOptions } from '../../../types';
|
|
4
|
+
export interface RememberRuntimeLinkedCssSourcesOptions {
|
|
5
|
+
bundleFiles: string[];
|
|
6
|
+
defaultStyleOutputExtension: string;
|
|
7
|
+
debug: (message: string, ...args: unknown[]) => void;
|
|
8
|
+
getConfiguredTailwindV4CssSourceEntries: () => Array<{
|
|
9
|
+
file: string;
|
|
10
|
+
source: string;
|
|
11
|
+
}>;
|
|
12
|
+
getSourceCandidateSource?: ((file: string) => string | undefined) | undefined;
|
|
13
|
+
getSourceCandidateSources?: (() => Iterable<[string, string]>) | undefined;
|
|
14
|
+
isWebGeneratorTarget: boolean;
|
|
15
|
+
jsImportedCssFiles: Set<string>;
|
|
16
|
+
opts: Pick<InternalUserDefinedOptions, 'cssMatcher' | 'platform'>;
|
|
17
|
+
outDir: string;
|
|
18
|
+
rememberCssSource?: ((source: RememberedCssSource) => void) | undefined;
|
|
19
|
+
rootDir: string;
|
|
20
|
+
runtimeLinkedCssFiles: Set<string>;
|
|
21
|
+
shouldPreserveAppCssExtension: boolean;
|
|
22
|
+
snapshot: BundleSnapshot;
|
|
23
|
+
sourceRoot?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare function rememberRuntimeLinkedCssSources(options: RememberRuntimeLinkedCssSourcesOptions): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ResolveCurrentSourceCandidateSourceOptions {
|
|
2
|
+
file: string;
|
|
3
|
+
getSourceCandidateSource?: ((file: string) => string | undefined) | undefined;
|
|
4
|
+
getSourceCandidateSources?: (() => Iterable<[string, string]> | undefined) | undefined;
|
|
5
|
+
outDir: string;
|
|
6
|
+
rootDir: string;
|
|
7
|
+
sourceRoot?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function resolveCurrentSourceCandidateSource(options: ResolveCurrentSourceCandidateSourceOptions): string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface TailwindV4GenerationCssSourceEntry {
|
|
2
|
+
file: string;
|
|
3
|
+
source: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function collectTailwindV4SourceFingerprint(source: string): Set<string>;
|
|
6
|
+
export declare function scoreConfiguredTailwindV4SourceForRawSource(rawSource: string | undefined, entrySource: string): number;
|
|
7
|
+
export declare function resolveSubpackageRootForFile(file: string | undefined, subpackageRoots: Set<string> | undefined): string | undefined;
|
|
8
|
+
export declare function isSameSubpackageScope(outputFile: string, sourceFile: string | undefined, subpackageRoots: Set<string> | undefined): boolean;
|
|
9
|
+
export declare function selectTailwindV4GenerationCssSourceForOutput<T extends TailwindV4GenerationCssSourceEntry>(outputFile: string, entries: T[], rawSource?: string, subpackageRoots?: Set<string> | undefined): T | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
type TransformMatcher = (id: string) => boolean;
|
|
4
|
+
interface TransformFilter {
|
|
5
|
+
include?: TransformMatcher | undefined;
|
|
6
|
+
exclude?: TransformMatcher | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function createTransformFilter(options: InternalUserDefinedOptions['transform'], rootDir: string): {
|
|
9
|
+
include: ((id: string) => boolean) | undefined;
|
|
10
|
+
exclude: ((id: string) => boolean) | undefined;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export declare function shouldSkipViteJsChunkTransform(chunk: OutputChunk, filter: TransformFilter | undefined): boolean;
|
|
13
|
+
export declare function shouldSkipViteAssetTransform(asset: OutputAsset, file: string, rootDir: string, filter: TransformFilter | undefined): boolean;
|
|
14
|
+
export declare function createTransformFilterSignature(options: InternalUserDefinedOptions['transform']): string;
|
|
15
|
+
export {};
|
|
@@ -15,6 +15,7 @@ export interface GenerateBundleContext {
|
|
|
15
15
|
ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean, options?: {
|
|
16
16
|
allowBaselineOnlyInitialSync?: boolean | undefined;
|
|
17
17
|
baseClassSet?: Set<string> | undefined;
|
|
18
|
+
refreshBySource?: boolean | undefined;
|
|
18
19
|
transformOnly?: boolean | undefined;
|
|
19
20
|
}) => Promise<Set<string>>;
|
|
20
21
|
debug: (format: string, ...args: unknown[]) => void;
|
|
@@ -3,7 +3,6 @@ import type { GenerateBundleContext, GenerateBundleThis } from './generate-bundl
|
|
|
3
3
|
export { normalizeBundleFileNameKeysForTest } from './generate-bundle/bundle-file-names';
|
|
4
4
|
export { resolveMiniProgramStyleOutputExtension, resolveReplayCssOutputFile, resolveReplayCssOutputFileFromSourceRoot, resolveViteCssPipelineOutputFile, resolveViteCssPipelineOutputFileFromSourceFile } from './generate-bundle/css-output';
|
|
5
5
|
export { resolveRememberedCssSourceForTest } from './generate-bundle/remembered-css';
|
|
6
|
+
export { shouldKeepRootMiniProgramStyleAsImportShell, shouldMoveRootMiniProgramStyleToImportShellOrigin } from './generate-bundle/root-style-output';
|
|
6
7
|
export type { GenerateBundleContext, GenerateBundleThis, RememberedCssSource } from './generate-bundle/types';
|
|
7
|
-
export declare function shouldKeepRootMiniProgramStyleAsImportShell(appType: unknown): appType is "uni-app-x" | "taro" | "uni-app-vite";
|
|
8
|
-
export declare function shouldMoveRootMiniProgramStyleToImportShellOrigin(appType: unknown): appType is "taro";
|
|
9
8
|
export declare function createGenerateBundleHook(context: GenerateBundleContext): (this: GenerateBundleThis, _opt: unknown, bundle: Record<string, OutputAsset | OutputChunk>) => Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function isMissingInternalCssSource(file: string, packageDir: string): boolean;
|
|
2
|
+
export declare function normalizeVitePersistentCacheKey(file: string): string;
|
|
3
|
+
export declare function toMb(bytes: number): number;
|
|
4
|
+
export declare function summarizeStringCache(map: Map<string, string>): {
|
|
5
|
+
bytes: number;
|
|
6
|
+
mb: number;
|
|
7
|
+
size: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function summarizeViteProcessedCssResults(map: Map<string, {
|
|
10
|
+
css: string;
|
|
11
|
+
}>): {
|
|
12
|
+
bytes: number;
|
|
13
|
+
mb: number;
|
|
14
|
+
size: number;
|
|
15
|
+
};
|
|
@@ -17,9 +17,10 @@ export declare function createViteRuntimeClassSet(options: CreateViteRuntimeClas
|
|
|
17
17
|
};
|
|
18
18
|
refreshRuntimeState: (force: boolean) => Promise<void>;
|
|
19
19
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
20
|
-
ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean,
|
|
20
|
+
ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean, options?: {
|
|
21
21
|
allowBaselineOnlyInitialSync?: boolean | undefined;
|
|
22
22
|
baseClassSet?: Set<string> | undefined;
|
|
23
|
+
refreshBySource?: boolean | undefined;
|
|
23
24
|
transformOnly?: boolean | undefined;
|
|
24
25
|
}) => Promise<Set<string>>;
|
|
25
26
|
};
|
|
@@ -7,10 +7,10 @@ export declare function hasLoaderEntry(entries: Array<{
|
|
|
7
7
|
}>, target?: string): boolean;
|
|
8
8
|
interface ChunkLike {
|
|
9
9
|
id?: string | number | null;
|
|
10
|
-
name?: string;
|
|
10
|
+
name?: string | undefined;
|
|
11
11
|
hash?: string | null;
|
|
12
|
-
files?: Iterable<string> | Array<string
|
|
13
|
-
hasRuntime?: () => boolean;
|
|
12
|
+
files?: Iterable<string> | Array<string> | undefined;
|
|
13
|
+
hasRuntime?: (() => boolean) | undefined;
|
|
14
14
|
}
|
|
15
15
|
interface ModuleLike {
|
|
16
16
|
context?: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SetupWebpackV5ProcessAssetsHookOptions } from './helpers';
|
|
2
|
+
import type { WebpackCssHandlerOptions } from './pipeline-helpers';
|
|
3
|
+
export declare function createWebpackCssSourceResolvers(options: {
|
|
4
|
+
activeWebpackAssetResourceFiles: ReadonlySet<string>;
|
|
5
|
+
appType: SetupWebpackV5ProcessAssetsHookOptions['appType'];
|
|
6
|
+
compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'];
|
|
7
|
+
compilation: {
|
|
8
|
+
chunks: Iterable<{
|
|
9
|
+
files?: Iterable<string> | string[] | undefined;
|
|
10
|
+
hasRuntime?: () => boolean;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
cssAssetResources: ReadonlyMap<string, ReadonlySet<string>>;
|
|
15
|
+
cssHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>;
|
|
16
|
+
cssSources: Map<string, {
|
|
17
|
+
css: string | undefined;
|
|
18
|
+
processed?: boolean | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
cssUserHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>;
|
|
21
|
+
groupedCssEntriesLength: number;
|
|
22
|
+
singleCssAssetFile?: string | undefined;
|
|
23
|
+
isWebGeneratorTarget: boolean;
|
|
24
|
+
outputDir: string;
|
|
25
|
+
runtimeState: SetupWebpackV5ProcessAssetsHookOptions['runtimeState'];
|
|
26
|
+
}): {
|
|
27
|
+
activeWebpackCssSourceFiles: Set<string>;
|
|
28
|
+
configuredMainCssEntryFiles: string[];
|
|
29
|
+
getCssHandlerOptions: (file: string, rawSource?: string | undefined) => WebpackCssHandlerOptions;
|
|
30
|
+
getCssUserHandlerOptions: (file: string) => WebpackCssHandlerOptions;
|
|
31
|
+
hasConfiguredTailwindV4SourceRoots: () => boolean;
|
|
32
|
+
isSameWebpackSourceScope: (outputFile: string, candidateSourceFile: string, currentSourceFile?: string | undefined) => boolean;
|
|
33
|
+
resolveWebpackCssSourceFile: (file: string, rawSource?: string | undefined) => string | undefined;
|
|
34
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { sources as WebpackSources } from 'webpack';
|
|
2
|
+
import type { SetupWebpackV5ProcessAssetsHookOptions } from './helpers';
|
|
3
|
+
import type { LinkedJsModuleResult } from '../../../../types';
|
|
4
|
+
export declare function createWebpackJsAssetModuleGraph(options: {
|
|
5
|
+
compilation: {
|
|
6
|
+
getAsset: (file: string) => {
|
|
7
|
+
source: {
|
|
8
|
+
source: () => unknown;
|
|
9
|
+
};
|
|
10
|
+
} | undefined;
|
|
11
|
+
};
|
|
12
|
+
compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'];
|
|
13
|
+
entries: Array<[string, unknown]>;
|
|
14
|
+
outputDir: string;
|
|
15
|
+
}): {
|
|
16
|
+
jsAssets: Map<string, string>;
|
|
17
|
+
moduleGraphOptions: {
|
|
18
|
+
resolve(specifier: string, importer: string): string | undefined;
|
|
19
|
+
load: (id: string) => string | undefined;
|
|
20
|
+
filter(id: string): boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare function applyWebpackLinkedJsResults(options: {
|
|
24
|
+
ConcatSource: new (code: string) => WebpackSources.Source;
|
|
25
|
+
compilation: {
|
|
26
|
+
getAsset: (file: string) => {
|
|
27
|
+
source: {
|
|
28
|
+
source: () => unknown;
|
|
29
|
+
};
|
|
30
|
+
} | undefined;
|
|
31
|
+
updateAsset: (file: string, source: WebpackSources.Source) => void;
|
|
32
|
+
};
|
|
33
|
+
compilerOptions: SetupWebpackV5ProcessAssetsHookOptions['options'];
|
|
34
|
+
debug: SetupWebpackV5ProcessAssetsHookOptions['debug'];
|
|
35
|
+
jsAssets: ReadonlyMap<string, string>;
|
|
36
|
+
linked: Record<string, LinkedJsModuleResult> | undefined;
|
|
37
|
+
}): void;
|