weapp-tailwindcss 5.0.13 → 5.1.1
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 +1 -1
- package/README.md +1 -1
- package/dist/auto-Ba6hDrse.mjs +13 -0
- package/dist/auto-DtU6f3X6.js +18 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +2 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +10 -6
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +0 -1
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/types.d.ts +13 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -1
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/shared/run-tasks.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +16 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +0 -1
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- 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/css-output.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +13 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +7 -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/memory-debug.d.ts +21 -18
- 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/sfc-style-source.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +1 -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 +2 -1
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle.d.ts +2 -1
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +3 -3
- package/dist/bundlers/vite/plugin-cache.d.ts +15 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +5 -4
- package/dist/bundlers/vite/source-candidates/script.d.ts +1 -7
- package/dist/bundlers/vite/source-candidates.d.ts +9 -2
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +2 -6
- package/dist/bundlers/vite/source-scan.d.ts +2 -2
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/utils.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +26 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +34 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -11
- 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-cache.d.ts +28 -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/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +4 -2
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +10 -1
- package/dist/bundlers/webpack/shared/css-loader-runtime.d.ts +1 -0
- package/dist/cache/index.d.ts +1 -0
- package/dist/cli/mount-options.d.ts +2 -2
- package/dist/cli.js +138 -444
- package/dist/cli.mjs +134 -440
- package/dist/context/index.d.ts +3 -3
- package/dist/context/style-options.d.ts +5 -1
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/{precheck-B0Z8yW7E.js → context-B6hVF7dr.js} +405 -156
- package/dist/{precheck-CRI90iL1.mjs → context-DlpKD7aN.mjs} +377 -141
- package/dist/core.js +15 -12
- package/dist/core.mjs +10 -7
- package/dist/css-macro/index.d.ts +3 -7
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-Bqx18S1f.mjs → defaults-BhE26nSw.mjs} +12 -13
- package/dist/{defaults-C_J_kBpw.js → defaults-CmFBmxsr.js} +11 -18
- package/dist/defaults.d.ts +2 -8
- package/dist/defaults.js +1 -2
- package/dist/defaults.mjs +2 -2
- package/dist/generator/index.d.ts +6 -7
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +9 -10
- package/dist/generator-6oMJtTDO.js +170 -0
- package/dist/generator-CjzBK7h-.mjs +123 -0
- package/dist/generator.js +10 -16
- package/dist/generator.mjs +3 -3
- package/dist/{gulp-XT8Jc7lH.js → gulp-BtGq6LP9.js} +49 -87
- package/dist/{gulp-DfOQERcV.mjs → gulp-DNU10Vtc.mjs} +42 -80
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DQIP_8qP.mjs → hmr-timing-B0KuWDjV.mjs} +1197 -858
- package/dist/{hmr-timing-BMftW7Us.js → hmr-timing-CegXR9O4.js} +1356 -927
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/fast-path/oxc.d.ts +4 -0
- package/dist/js/precheck.d.ts +1 -0
- package/dist/postcss.js +3 -4
- package/dist/postcss.mjs +2 -3
- package/dist/presets.js +9 -19
- package/dist/presets.mjs +8 -18
- package/dist/runtime-branch/create-branch.d.ts +2 -0
- package/dist/runtime-branch/generator-target-env.d.ts +4 -0
- package/dist/runtime-branch/index.d.ts +6 -0
- package/dist/runtime-branch/mini-program.d.ts +2 -0
- package/dist/runtime-branch/native-app.d.ts +2 -0
- package/dist/runtime-branch/platform.d.ts +6 -0
- package/dist/runtime-branch/tailwind-version.d.ts +2 -0
- package/dist/runtime-branch/types.d.ts +37 -0
- package/dist/runtime-branch/web.d.ts +2 -0
- package/dist/runtime-branch.d.ts +1 -0
- package/dist/{bundle-state-zQ2MrDdi.mjs → source-candidate-scan-signature-B5af2Ahe.mjs} +187 -17
- package/dist/{bundle-state-CKWeTEhv.js → source-candidate-scan-signature-BKYb9jxa.js} +261 -19
- package/dist/tailwindcss/candidates.d.ts +7 -0
- package/dist/tailwindcss/index.d.ts +2 -2
- package/dist/tailwindcss/runtime/cache.d.ts +6 -6
- package/dist/tailwindcss/runtime-factory.d.ts +12 -0
- package/dist/tailwindcss/runtime-options.d.ts +8 -0
- package/dist/tailwindcss/runtime-types.d.ts +87 -0
- package/dist/tailwindcss/runtime.d.ts +6 -6
- package/dist/tailwindcss/source-scan.d.ts +1 -1
- package/dist/tailwindcss/targets.d.ts +2 -2
- package/dist/tailwindcss/v4/config.d.ts +3 -3
- package/dist/tailwindcss/v4/css-entries.d.ts +1 -0
- package/dist/tailwindcss/v4/css-sources.d.ts +4 -2
- package/dist/tailwindcss/v4/index.d.ts +1 -1
- package/dist/tailwindcss/v4/multi-runtime.d.ts +2 -0
- package/dist/tailwindcss/v4/runtime-factory.d.ts +15 -0
- package/dist/tailwindcss/v4/runtime-options.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +3 -3
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +10 -3
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +7 -1
- package/dist/tailwindcss/v4-engine/source.d.ts +15 -7
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -10
- package/dist/tailwindcss/version.d.ts +1 -1
- package/dist/tailwindcss-B5mRo0-M.mjs +1423 -0
- package/dist/tailwindcss-dbrbY4cd.js +1528 -0
- package/dist/{transform-DfcEjsZF.mjs → transform-fRBeuuK-.mjs} +2 -2
- package/dist/{transform-YmrmxuF3.js → transform-vLwZpiTE.js} +17 -17
- package/dist/typedoc.export.d.ts +1 -1
- package/dist/types/index.d.ts +16 -17
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/{typedoc-tailwindcss-patch.d.ts → typedoc-tailwindcss-runtime.d.ts} +4 -10
- package/dist/types/user-defined-options/general.d.ts +5 -3
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/types/user-defined-options/matcher.d.ts +7 -0
- package/dist/uni-app-x/style-asset.d.ts +1 -0
- package/dist/v4-engine-C3qSwQ-e.mjs +2376 -0
- package/dist/v4-engine-ON_oSLfO.js +2752 -0
- package/dist/{vite-DjI09vVN.mjs → vite-CWRooooa.mjs} +1417 -540
- package/dist/{vite-CXHVsHmX.js → vite-w-RkgaTY.js} +1575 -698
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +5665 -4443
- package/dist/weapp-tw-runtime-classset-loader.js +15 -4
- package/dist/webpack-8PaV1gG3.mjs +2334 -0
- package/dist/webpack-CGgBOx9l.js +2346 -0
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +6 -7
- package/dist/auto-CTp6wE5a.js +0 -33
- package/dist/auto-Cl8_hsG6.mjs +0 -22
- package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +0 -13
- package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +0 -1
- package/dist/context/tailwindcss/rax.d.ts +0 -2
- package/dist/generator-CzpArpCL.js +0 -92
- package/dist/generator-ITLd7PTl.mjs +0 -67
- package/dist/tailwindcss/patcher-options.d.ts +0 -8
- package/dist/tailwindcss/patcher.d.ts +0 -12
- package/dist/tailwindcss/runtime-patch.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +0 -3
- package/dist/tailwindcss/v3-engine/generator/content.d.ts +0 -10
- package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +0 -2
- package/dist/tailwindcss/v3-engine/generator.d.ts +0 -19
- package/dist/tailwindcss/v3-engine/index.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/source.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +0 -61
- package/dist/tailwindcss/v4/multi-patcher.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher.d.ts +0 -15
- package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +0 -1
- package/dist/tailwindcss-DTq3uYBK.mjs +0 -556
- package/dist/tailwindcss-DZEwT3C_.js +0 -613
- package/dist/v3-engine-2rrgylhn.js +0 -4686
- package/dist/v3-engine-C6eJ0YzK.mjs +0 -4272
- package/dist/webpack-BcPpnT90.mjs +0 -1184
- package/dist/webpack-CfkUkMXG.js +0 -1196
- /package/dist/tailwindcss/{patcher-resolve.d.ts → runtime-resolve.d.ts} +0 -0
|
@@ -3,7 +3,9 @@ import type { BundleSnapshot } from '../bundle-state';
|
|
|
3
3
|
import type { RememberedCssSource } from './types';
|
|
4
4
|
export declare function extractSfcStyleSources(source: string): string[];
|
|
5
5
|
export declare function hasSfcStyleSources(source: string): boolean;
|
|
6
|
-
export declare function hasTailwindGenerationSource(source: string
|
|
6
|
+
export declare function hasTailwindGenerationSource(source: string, options?: {
|
|
7
|
+
allowRootDirectives?: boolean | undefined;
|
|
8
|
+
}): boolean;
|
|
7
9
|
export declare function resolveSfcStyleSourceFromOutputFile(outputFile: string, snapshot: BundleSnapshot, outputRoot: string, sourceRoot: string | undefined, cssMatcher: ((file: string) => boolean) | undefined, getSfcSource: ((file: string) => string | undefined) | undefined, debug: (format: string, ...args: unknown[]) => void): Promise<RememberedCssSource | undefined>;
|
|
8
10
|
export declare function normalizeSfcSourceFileForCompare(file: string): string;
|
|
9
11
|
export declare function collectChunkModuleIds(output: OutputChunk): string[];
|
|
@@ -2,6 +2,7 @@ import type { BundleSnapshot } from '../bundle-state';
|
|
|
2
2
|
import type { SourceCandidateFilterOptions } from '../source-candidates';
|
|
3
3
|
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
4
4
|
interface CreateSubpackageSourceCandidateScopeOptions {
|
|
5
|
+
cssSourceFiles?: Iterable<string> | undefined;
|
|
5
6
|
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>) | undefined;
|
|
6
7
|
getSourceCandidateSourcesForEntries?: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined;
|
|
7
8
|
projectRoot?: string | undefined;
|
|
@@ -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 {};
|
|
@@ -8,13 +8,14 @@ import type { InternalUserDefinedOptions } from '../../../types';
|
|
|
8
8
|
export interface GenerateBundleContext {
|
|
9
9
|
opts: InternalUserDefinedOptions;
|
|
10
10
|
runtimeState: {
|
|
11
|
-
|
|
11
|
+
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
12
12
|
readyPromise: Promise<void>;
|
|
13
13
|
};
|
|
14
14
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function resolveViteCssTaskConcurrency(
|
|
1
|
+
export declare function resolveViteCssTaskConcurrency(_useIncrementalMode: boolean, _majorVersion?: number | undefined): number;
|
|
2
2
|
export declare function normalizeViteCssCacheKey(file: string): string;
|
|
3
3
|
export declare function rememberLastCssResult(resultByFile: Map<string, string>, sourceHashByFile: Map<string, string>, file: string, css: string, sourceHash: string): void;
|
|
4
4
|
export declare function getLastCssResult(resultByFile: Map<string, string>, ...files: Array<string | undefined>): string | undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
2
|
import type { GenerateBundleContext, GenerateBundleThis } from './generate-bundle/types';
|
|
3
3
|
export { normalizeBundleFileNameKeysForTest } from './generate-bundle/bundle-file-names';
|
|
4
|
-
export { resolveMiniProgramStyleOutputExtension, resolveReplayCssOutputFile, resolveReplayCssOutputFileFromSourceRoot, resolveViteCssPipelineOutputFile } from './generate-bundle/css-output';
|
|
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
8
|
export declare function createGenerateBundleHook(context: GenerateBundleContext): (this: GenerateBundleThis, _opt: unknown, bundle: Record<string, OutputAsset | OutputChunk>) => Promise<void>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare function createEscapeFragments(escapeMap: Record<string, string>): string[];
|
|
2
2
|
export declare function collectEscapedRuntimeCandidates(source: string, escapeMap: Record<string, string>, escapeFragments: string[]): Set<string>;
|
|
3
|
+
export declare function collectStrictEscapedRuntimeCandidates(source: string, escapeMap: Record<string, string>, escapeFragments: string[]): Set<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BundleSnapshot } from './bundle-state';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TailwindcssRuntimeLike } from '../../types';
|
|
3
3
|
import type { IArbitraryValues } from '../../types/shared';
|
|
4
|
-
import { extractRawCandidatesWithPositions, extractValidCandidates } from 'tailwindcss-
|
|
4
|
+
import { extractRawCandidatesWithPositions, extractValidCandidates } from '@tailwindcss-mangle/engine';
|
|
5
5
|
type ExtractValidCandidatesOptions = Parameters<typeof extractValidCandidates>[0];
|
|
6
6
|
type MemoryExtractValidCandidatesOptions = ExtractValidCandidatesOptions & {
|
|
7
7
|
content?: string;
|
|
@@ -13,7 +13,7 @@ type ExtractRawCandidatesFn = (content: string, extension?: string, options?: {
|
|
|
13
13
|
bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
|
|
14
14
|
}) => Promise<ExtractRawCandidateResult>;
|
|
15
15
|
export interface BundleRuntimeClassSetManager {
|
|
16
|
-
sync: (
|
|
16
|
+
sync: (runtime: TailwindcssRuntimeLike, snapshot: BundleSnapshot, options?: BundleRuntimeClassSetSyncOptions) => Promise<Set<string>>;
|
|
17
17
|
reset: () => Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
export interface BundleRuntimeClassSetSyncOptions {
|
|
@@ -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
|
+
};
|
|
@@ -18,6 +18,7 @@ interface RewriteCssImportsOptions {
|
|
|
18
18
|
onTailwindRootCss?: ((id: string, code: string) => Promise<void> | void) | undefined;
|
|
19
19
|
onCssSourceTransform?: ((id: string, code: string) => Promise<void> | void) | undefined;
|
|
20
20
|
shouldGenerateCss?: ((id: string, code: string) => boolean) | undefined;
|
|
21
|
+
shouldDeferGeneration?: ((id: string, code: string) => boolean) | undefined;
|
|
21
22
|
}
|
|
22
23
|
export declare function createRewriteCssImportsPlugins(options: RewriteCssImportsOptions): Plugin[];
|
|
23
24
|
export declare function hasVitePipelineTailwindGenerationDirective(code: string): boolean;
|
|
@@ -2,8 +2,8 @@ import type { BundleSnapshot } from './bundle-state';
|
|
|
2
2
|
import type { InternalUserDefinedOptions } from '../../types';
|
|
3
3
|
interface CreateViteRuntimeClassSetOptions {
|
|
4
4
|
opts: InternalUserDefinedOptions;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
initialTailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
6
|
+
refreshTailwindcssRuntime: InternalUserDefinedOptions['refreshTailwindcssRuntime'];
|
|
7
7
|
uniAppXEnabled: boolean;
|
|
8
8
|
customAttributesEntities: unknown;
|
|
9
9
|
disabledDefaultTemplateHandler: boolean;
|
|
@@ -11,15 +11,16 @@ interface CreateViteRuntimeClassSetOptions {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function createViteRuntimeClassSet(options: CreateViteRuntimeClassSetOptions): {
|
|
13
13
|
runtimeState: {
|
|
14
|
-
|
|
14
|
+
tailwindRuntime: import("@/types").TailwindcssRuntimeLike;
|
|
15
15
|
readyPromise: Promise<void>;
|
|
16
|
-
|
|
16
|
+
refreshTailwindcssRuntime: (options?: import("@/types").RefreshTailwindcssRuntimeOptions) => Promise<import("@/types").TailwindcssRuntimeLike>;
|
|
17
17
|
};
|
|
18
18
|
refreshRuntimeState: (force: boolean) => Promise<void>;
|
|
19
19
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
20
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
|
};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface ScriptCandidateExtractionOptions {
|
|
3
|
-
bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
|
|
4
|
-
extractor?: ((source: string, extension: string) => Promise<Iterable<string>> | Iterable<string>) | undefined;
|
|
5
|
-
}
|
|
6
|
-
export declare function extractScriptStringCandidates(source: string, extension: string, options: ScriptCandidateExtractionOptions): Promise<never[] | Set<string>>;
|
|
7
|
-
export {};
|
|
1
|
+
export { extractScriptStringCandidates } from '../../../tailwindcss/candidates';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
|
|
2
2
|
import type { IArbitraryValues } from '../../types/shared';
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export interface SourceCandidateStore {
|
|
4
|
+
syncSource: (id: string, source: string) => Promise<void>;
|
|
5
5
|
sync: (id: string, source: string) => Promise<void>;
|
|
6
6
|
syncCss: (id: string, source: string) => Promise<void>;
|
|
7
7
|
merge: (id: string, source: string) => Promise<void>;
|
|
@@ -21,12 +21,17 @@ export interface SourceCandidateCollector {
|
|
|
21
21
|
resetScan: () => void;
|
|
22
22
|
clear: () => void;
|
|
23
23
|
}
|
|
24
|
+
export interface SourceCandidateCollector extends SourceCandidateStore {
|
|
25
|
+
}
|
|
24
26
|
export interface SourceCandidateCollectorSnapshot {
|
|
25
27
|
candidatesById: Array<[string, string[]]>;
|
|
26
28
|
cssCandidatesById?: Array<[string, string[]]> | undefined;
|
|
29
|
+
cssSourceById?: Array<[string, string]> | undefined;
|
|
27
30
|
scanCandidatesById?: Array<[string, string[]]> | undefined;
|
|
31
|
+
scanSourceById?: Array<[string, string]> | undefined;
|
|
28
32
|
sourceById?: Array<[string, string]> | undefined;
|
|
29
33
|
transformCandidatesById?: Array<[string, string[]]> | undefined;
|
|
34
|
+
transformSourceById?: Array<[string, string]> | undefined;
|
|
30
35
|
inlineExcludedCandidates: string[];
|
|
31
36
|
inlineIncludedCandidates: string[];
|
|
32
37
|
}
|
|
@@ -44,6 +49,7 @@ export interface SourceCandidateCollectorOptions {
|
|
|
44
49
|
extractor?: ((source: string, extension: string) => Promise<Iterable<string>> | Iterable<string>) | undefined;
|
|
45
50
|
}
|
|
46
51
|
export declare function isSourceCandidateRequest(id: string): boolean;
|
|
52
|
+
export declare function createSourceCandidateStore(options?: SourceCandidateCollectorOptions): SourceCandidateStore;
|
|
47
53
|
export declare function createSourceCandidateCollector(options?: SourceCandidateCollectorOptions): SourceCandidateCollector;
|
|
48
54
|
export declare function getSourceCandidateContentCacheStatsForTest(): {
|
|
49
55
|
max: number;
|
|
@@ -51,3 +57,4 @@ export declare function getSourceCandidateContentCacheStatsForTest(): {
|
|
|
51
57
|
keys: string[];
|
|
52
58
|
};
|
|
53
59
|
export declare function clearSourceCandidateContentCacheForTest(): void;
|
|
60
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TailwindV4CssSource } from 'tailwindcss-
|
|
1
|
+
import type { TailwindV4CssSource } from '@tailwindcss-mangle/engine';
|
|
2
2
|
import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
3
|
-
import type {
|
|
3
|
+
import type { UserDefinedOptions } from '../../../types';
|
|
4
4
|
export interface ResolvedTailwindV4CssEntries {
|
|
5
5
|
entries: TailwindSourceEntry[];
|
|
6
6
|
explicit: boolean;
|
|
@@ -11,10 +11,6 @@ export declare function mergeTailwindInlineSourceCandidates(allInlineCandidates:
|
|
|
11
11
|
export declare function resolveTailwindV4EntriesFromCss(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
|
|
12
12
|
export declare function resolveViteTailwindV4CssDependencies(css: string, base: string): Promise<string[]>;
|
|
13
13
|
export declare function collectExistingCssEntries(options: UserDefinedOptions): string[];
|
|
14
|
-
export declare function resolveTailwindV3CssEntryScan(options: UserDefinedOptions, patcher: TailwindcssPatcherLike): Promise<{
|
|
15
|
-
entries: TailwindSourceEntry[];
|
|
16
|
-
dependencies: Set<string>;
|
|
17
|
-
}>;
|
|
18
14
|
export declare function resolveTailwindV4EntriesFromCssCached(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
|
|
19
15
|
export declare function resolveTailwindConfigEntriesFromCssCached(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
|
|
20
16
|
export declare function discoverTailwindV4CssEntries(root: string, outDir: string | undefined): Promise<string[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TailwindcssRuntimeLike, UserDefinedOptions } from '../../types';
|
|
3
3
|
export { discoverTailwindV4CssEntries, resolveTailwindConfigEntriesFromCssCached, resolveTailwindV4EntriesFromCss, resolveTailwindV4EntriesFromCssCached, resolveViteTailwindV4CssDependencies, } from './source-scan/css-entries';
|
|
4
4
|
export type { ResolvedTailwindV4CssEntries } from './source-scan/css-entries';
|
|
5
5
|
export interface ResolvedViteSourceScan {
|
|
@@ -12,5 +12,5 @@ interface ResolveViteSourceScanOptions {
|
|
|
12
12
|
root?: string | undefined;
|
|
13
13
|
outDir?: string | undefined;
|
|
14
14
|
}
|
|
15
|
-
export declare function resolveViteSourceScanEntries(options: UserDefinedOptions,
|
|
15
|
+
export declare function resolveViteSourceScanEntries(options: UserDefinedOptions, runtime: TailwindcssRuntimeLike, scanOptions?: ResolveViteSourceScanOptions): Promise<ResolvedViteSourceScan | undefined>;
|
|
16
16
|
export declare function createViteSourceScanMatcher(entries: TailwindSourceEntry[] | undefined): ((file: string) => boolean) | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { InternalUserDefinedOptions, IStyleHandlerOptions } from '../../types';
|
|
2
|
-
export declare function resolveUniAppXNativeCssHandlerOptions(opts: Pick<InternalUserDefinedOptions, 'appType' | 'uniAppX'>): Partial<IStyleHandlerOptions>;
|
|
2
|
+
export declare function resolveUniAppXNativeCssHandlerOptions(opts: Pick<InternalUserDefinedOptions, 'appType' | 'generator' | 'platform' | 'cssOptions' | 'uniAppX'>): Partial<IStyleHandlerOptions>;
|
|
@@ -4,6 +4,7 @@ export declare function slash(p: string): string;
|
|
|
4
4
|
export declare const isWindows: boolean;
|
|
5
5
|
export declare const cssLangRE: RegExp;
|
|
6
6
|
export declare function isCSSRequest(request: string): boolean;
|
|
7
|
+
export declare function isHTMLRequest(request: string): boolean;
|
|
7
8
|
export declare function normalizePath(id: string): string;
|
|
8
9
|
export { cleanUrl };
|
|
9
10
|
export declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
|
|
@@ -7,9 +7,24 @@ 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
|
|
12
|
+
files?: Iterable<string> | Array<string> | undefined;
|
|
13
|
+
hasRuntime?: (() => boolean) | undefined;
|
|
14
|
+
}
|
|
15
|
+
interface ModuleLike {
|
|
16
|
+
context?: string;
|
|
17
|
+
dependencies?: Array<unknown> | Iterable<unknown>;
|
|
18
|
+
modules?: ModuleLike[] | Iterable<ModuleLike>;
|
|
19
|
+
request?: string;
|
|
20
|
+
resource?: string;
|
|
21
|
+
rootModule?: ModuleLike;
|
|
22
|
+
userRequest?: string;
|
|
23
|
+
}
|
|
24
|
+
interface ChunkGraphLike {
|
|
25
|
+
getChunkModulesIterable?: (chunk: ChunkLike) => Iterable<ModuleLike> | undefined;
|
|
26
|
+
getIssuer?: (module: ModuleLike) => ModuleLike | null | undefined;
|
|
27
|
+
getModule?: (dependency: unknown) => ModuleLike | null | undefined;
|
|
13
28
|
}
|
|
14
29
|
interface WebpackWatchChangeLike {
|
|
15
30
|
modifiedFiles?: Set<string>;
|
|
@@ -19,6 +34,15 @@ interface RuntimeWatchDependenciesLike {
|
|
|
19
34
|
files?: Iterable<string>;
|
|
20
35
|
contexts?: Iterable<string>;
|
|
21
36
|
}
|
|
37
|
+
export declare function inferWebpackMainCssFiles(chunks: Iterable<ChunkLike>, cssMatcher: (file: string) => boolean, options?: {
|
|
38
|
+
mainSourceFiles?: ReadonlySet<string> | undefined;
|
|
39
|
+
resourcesByAsset?: ReadonlyMap<string, ReadonlySet<string>> | undefined;
|
|
40
|
+
}): Set<string>;
|
|
41
|
+
export declare function resolveSingleActiveWebpackCssResource(assetResources: ReadonlySet<string> | undefined, activeWebpackAssetResourceFiles: ReadonlySet<string>): string | undefined;
|
|
42
|
+
export declare function createWebpackCssAssetResourceMap(chunks: Iterable<ChunkLike>, chunkGraph: ChunkGraphLike | undefined, cssMatcher: (file: string) => boolean, normalizeResource: (resource: string, issuer?: {
|
|
43
|
+
context?: string;
|
|
44
|
+
resource?: string;
|
|
45
|
+
}) => string | undefined): Map<string, Set<string>>;
|
|
22
46
|
export declare function createAssetHashByChunkMap(chunks: Iterable<ChunkLike>): Map<string, string>;
|
|
23
47
|
export declare function createRuntimeAwareCssHash(assetHash: string | undefined, sourceHash: string, runtimeSetHash: string): string;
|
|
24
48
|
export declare function hasWatchChanges(compiler: WebpackWatchChangeLike): boolean;
|
|
@@ -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
|
+
};
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
import type { Compiler, sources as WebpackSources } from 'webpack';
|
|
2
|
+
import type { BundleBuildState, BundleSnapshot } from '../../../vite/bundle-state';
|
|
2
3
|
import type { BundleRuntimeClassSetManager } from '../../../vite/incremental-runtime-class-set';
|
|
4
|
+
import type { WebpackGeneratedCssRegistration } from '../../loaders/runtime-registry';
|
|
3
5
|
import type { AppType, InternalUserDefinedOptions } from '../../../../types';
|
|
4
6
|
export interface SetupWebpackV5ProcessAssetsHookOptions {
|
|
5
7
|
compiler: Compiler;
|
|
6
8
|
options: InternalUserDefinedOptions;
|
|
7
9
|
appType?: AppType | undefined;
|
|
8
10
|
runtimeState: {
|
|
9
|
-
|
|
11
|
+
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
10
12
|
readyPromise: Promise<void>;
|
|
11
13
|
};
|
|
12
14
|
getRuntimeRefreshRequirement: () => boolean;
|
|
13
15
|
refreshRuntimeMetadata: (force: boolean) => Promise<void>;
|
|
14
|
-
|
|
16
|
+
isKnownWebpackProcessedCssAsset?: ((file: string, metadata?: {
|
|
17
|
+
isMainCssChunk?: boolean | undefined;
|
|
18
|
+
}) => boolean) | undefined;
|
|
19
|
+
isWebpackProcessedCssAsset?: ((file: string, rawSource: string, metadata?: {
|
|
20
|
+
isMainCssChunk?: boolean | undefined;
|
|
21
|
+
}) => boolean) | undefined;
|
|
15
22
|
consumeRuntimeRefreshRequirement: () => void;
|
|
16
23
|
isWatchMode?: (() => boolean) | undefined;
|
|
24
|
+
getWatchChangedFiles?: (() => Iterable<string>) | undefined;
|
|
17
25
|
runtimeClassSetManager?: BundleRuntimeClassSetManager | undefined;
|
|
18
|
-
getWebpackCssSources?: (() => Iterable<[string,
|
|
26
|
+
getWebpackCssSources?: (() => Iterable<[string, {
|
|
27
|
+
css: string | undefined;
|
|
28
|
+
processed?: boolean | undefined;
|
|
29
|
+
}]>) | undefined;
|
|
30
|
+
getWebpackGeneratedCssSources?: (() => Iterable<[string, WebpackGeneratedCssRegistration]>) | undefined;
|
|
31
|
+
pruneWebpackCssSources?: ((activeSourceFiles: ReadonlySet<string>, options?: {
|
|
32
|
+
watchMode?: boolean | undefined;
|
|
33
|
+
}) => void) | undefined;
|
|
34
|
+
prepareWebpackCssSources?: ((activeAssetResources?: ReadonlySet<string>) => ReadonlySet<string>) | undefined;
|
|
19
35
|
debug: (format: string, ...args: unknown[]) => void;
|
|
20
36
|
}
|
|
21
37
|
export type WebpackSourceLike = string | WebpackSources.Source;
|
|
@@ -27,15 +43,35 @@ interface WebpackAssetCompilationLike {
|
|
|
27
43
|
} | undefined;
|
|
28
44
|
updateAsset: Compiler['webpack']['Compilation']['prototype']['updateAsset'];
|
|
29
45
|
}
|
|
30
|
-
export declare function
|
|
46
|
+
export declare function buildWebpackBundleSnapshot(assets: Record<string, {
|
|
31
47
|
source: () => unknown;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
}>, opts: InternalUserDefinedOptions, state: BundleBuildState, compilation?: WebpackAssetCompilationLike | undefined): {
|
|
49
|
+
entries: import("../../../vite/bundle-state").BundleStateEntry[];
|
|
50
|
+
jsEntries: Map<any, any>;
|
|
51
|
+
sourceHashByFile: Map<string, string>;
|
|
52
|
+
runtimeAffectingSignatureByFile: Map<string, string>;
|
|
53
|
+
runtimeAffectingHashByFile: Map<string, string>;
|
|
54
|
+
hasOmittedKnownFiles: false;
|
|
55
|
+
changedByType: {
|
|
56
|
+
html: Set<string>;
|
|
57
|
+
js: Set<string>;
|
|
58
|
+
css: Set<string>;
|
|
59
|
+
other: Set<string>;
|
|
37
60
|
};
|
|
61
|
+
runtimeAffectingChangedByType: {
|
|
62
|
+
html: Set<string>;
|
|
63
|
+
js: Set<string>;
|
|
64
|
+
css: Set<string>;
|
|
65
|
+
other: Set<string>;
|
|
66
|
+
};
|
|
67
|
+
processFiles: {
|
|
68
|
+
html: Set<string>;
|
|
69
|
+
js: Set<string>;
|
|
70
|
+
css: Set<string>;
|
|
71
|
+
};
|
|
72
|
+
linkedImpactsByEntry: Map<any, any>;
|
|
38
73
|
};
|
|
74
|
+
export declare function releaseWebpackBundleSnapshotSources(snapshot: BundleSnapshot): void;
|
|
39
75
|
export declare function stringifyWebpackSource(source: unknown): string;
|
|
40
76
|
export declare function createWebpackAssetUpdater(options: {
|
|
41
77
|
compilation: WebpackAssetCompilationLike;
|
|
@@ -44,8 +80,9 @@ export declare function createWebpackAssetUpdater(options: {
|
|
|
44
80
|
debug: (format: string, ...args: unknown[]) => void;
|
|
45
81
|
}): {
|
|
46
82
|
getCurrentAssetSource: (file: string) => string | undefined;
|
|
47
|
-
updateAssetIfChanged: (file: string, source: WebpackSourceLike, { notifyUpdate }?: {
|
|
48
|
-
|
|
83
|
+
updateAssetIfChanged: (file: string, source: WebpackSourceLike, { compare, notifyUpdate, }?: {
|
|
84
|
+
compare?: boolean | undefined;
|
|
85
|
+
notifyUpdate?: boolean | undefined;
|
|
49
86
|
}) => boolean;
|
|
50
87
|
};
|
|
51
88
|
export {};
|
|
@@ -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;
|