weapp-tailwindcss 5.1.7 → 5.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundlers/framework-selector.d.ts +26 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +6 -0
- package/dist/bundlers/gulp/index.d.ts +4 -4
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +6 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/generic/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/uni-app/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/uni-app-x/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/weapp-vite/index.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +5 -1
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +5 -1
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +2 -0
- package/dist/bundlers/vite/index.d.ts +2 -4
- package/dist/bundlers/vite/processed-css-assets.d.ts +5 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +35 -0
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +88 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +1 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -2
- package/dist/bundlers/webpack/frameworks/generic/index.d.ts +5 -0
- package/dist/bundlers/webpack/frameworks/index.d.ts +8 -0
- package/dist/bundlers/webpack/frameworks/mpx/index.d.ts +5 -0
- package/dist/bundlers/webpack/frameworks/taro/index.d.ts +5 -0
- package/dist/bundlers/webpack/frameworks/uni-app/index.d.ts +5 -0
- package/dist/bundlers/webpack/frameworks/weapp-vite/index.d.ts +5 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin.d.ts +21 -0
- package/dist/bundlers/webpack/shared/loader-anchors.d.ts +4 -3
- package/dist/cli.js +8 -0
- package/dist/cli.mjs +8 -0
- package/dist/{context-C7KTDlrG.js → context-CRhUs_5e.js} +11 -3
- package/dist/{context-BqeDu1Ha.mjs → context-CfXr3hWz.mjs} +11 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-DASZwC6t.js → generator-DaaFxR5V.js} +1 -1
- package/dist/{generator-BOt2Tvx3.mjs → generator-DugIHBgl.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-alDZryyB.mjs → gulp-CRjkPsbX.mjs} +22 -7
- package/dist/{gulp-D6hsaTLM.js → gulp-JUfnhOOo.js} +22 -7
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-CYwVMRol.mjs → hmr-timing-BecOXMd8.mjs} +5 -5
- package/dist/{hmr-timing-BIr_CiPW.js → hmr-timing-DcIEXnf8.js} +5 -5
- 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/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-Djr2Hw8y.js → source-candidate-scan-signature-10tvdJVC.js} +185 -98
- package/dist/{source-candidate-scan-signature-D97ZEXcj.mjs → source-candidate-scan-signature-DAg8QSgh.mjs} +162 -99
- package/dist/style-injector/internal.d.ts +18 -4
- package/dist/{tailwindcss-DPxJpRVP.js → tailwindcss-BZjZZi60.js} +1 -1
- package/dist/{tailwindcss-DDGD90w7.mjs → tailwindcss-PA2jHHpx.mjs} +1 -1
- package/dist/{transform-CvqqZBuq.js → transform-B0BxX3XB.js} +1 -1
- package/dist/{transform-DPPr79r2.mjs → transform-wNEbcZeQ.mjs} +1 -1
- package/dist/uni-app-x/vite.d.ts +1 -0
- package/dist/{v4-engine-3UmJkAY7.js → v4-engine-BZP2462H.js} +12 -0
- package/dist/{v4-engine-CYSrDVNp.mjs → v4-engine-CjjWONB0.mjs} +12 -0
- package/dist/{vite-BJRlG835.js → vite-GdzlG_lx.js} +1286 -818
- package/dist/{vite-XxJh7Xtu.mjs → vite-vf2-cDdk.mjs} +1284 -816
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +21 -1
- package/dist/{webpack-eN8WzIT-.mjs → webpack-2s-TFhgm.mjs} +321 -216
- package/dist/{webpack-BxBOMUtY.js → webpack-BhM4Hqla.js} +320 -215
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DetectableAppType, DetectAppTypeOptions } from '../framework';
|
|
2
|
+
import type { AppType, UserDefinedOptions } from '../types';
|
|
3
|
+
export interface ResolveBundlerFrameworkOptions extends Pick<DetectAppTypeOptions, 'cwd' | 'env' | 'manifest' | 'packageJson' | 'root' | 'searchUp'> {
|
|
4
|
+
appType?: AppType | undefined;
|
|
5
|
+
detectEnv?: boolean | undefined;
|
|
6
|
+
uniAppX?: UserDefinedOptions['uniAppX'];
|
|
7
|
+
}
|
|
8
|
+
export type ViteFrameworkName = 'generic' | 'taro' | 'uni-app' | 'uni-app-x' | 'weapp-vite';
|
|
9
|
+
export type WebpackFrameworkName = 'generic' | 'mpx' | 'taro' | 'uni-app' | 'weapp-vite';
|
|
10
|
+
export type GulpFrameworkName = 'native';
|
|
11
|
+
export interface BundlerFrameworkProfile<Name extends string> {
|
|
12
|
+
appType?: AppType | DetectableAppType | undefined;
|
|
13
|
+
frameworkName: Name;
|
|
14
|
+
}
|
|
15
|
+
export type ViteFrameworkProfile = BundlerFrameworkProfile<ViteFrameworkName>;
|
|
16
|
+
export type WebpackFrameworkProfile = BundlerFrameworkProfile<WebpackFrameworkName>;
|
|
17
|
+
export type GulpFrameworkProfile = BundlerFrameworkProfile<GulpFrameworkName>;
|
|
18
|
+
export interface BundlerFrameworkState<Profile, Options> {
|
|
19
|
+
current: () => Profile;
|
|
20
|
+
refresh: (options?: Partial<Options>) => Profile;
|
|
21
|
+
}
|
|
22
|
+
export declare function resolveBundlerAppType(options: ResolveBundlerFrameworkOptions): AppType | DetectableAppType | undefined;
|
|
23
|
+
export declare function resolveViteFrameworkProfile(options: ResolveBundlerFrameworkOptions): ViteFrameworkProfile;
|
|
24
|
+
export declare function resolveWebpackFrameworkProfile(options: ResolveBundlerFrameworkOptions): WebpackFrameworkProfile;
|
|
25
|
+
export declare function resolveGulpFrameworkProfile(options: ResolveBundlerFrameworkOptions): GulpFrameworkProfile;
|
|
26
|
+
export declare function createViteFrameworkProfileState(options: ResolveBundlerFrameworkOptions): BundlerFrameworkState<ViteFrameworkProfile, ResolveBundlerFrameworkOptions>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { UserDefinedOptions } from '../../../../types';
|
|
2
|
+
export declare function createNativeGulpFrameworkPlugins(options?: UserDefinedOptions): {
|
|
3
|
+
transformWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
|
+
transformWxml: (options?: Partial<import("@/types").ITemplateHandlerOptions>) => import("node:stream").Transform;
|
|
5
|
+
transformJs: (options?: Partial<import("@/types").CreateJsHandlerOptions>) => import("node:stream").Transform;
|
|
6
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserDefinedOptions } from '../../types';
|
|
2
2
|
export declare function createPlugins(options?: UserDefinedOptions): {
|
|
3
|
-
transformWxss: (options?: Partial<IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
|
-
transformWxml: (options?: Partial<ITemplateHandlerOptions>) => import("node:stream").Transform;
|
|
5
|
-
transformJs: (options?: Partial<CreateJsHandlerOptions>) => import("node:stream").Transform;
|
|
3
|
+
transformWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
|
+
transformWxml: (options?: Partial<import("@/types").ITemplateHandlerOptions>) => import("node:stream").Transform;
|
|
5
|
+
transformJs: (options?: Partial<import("@/types").CreateJsHandlerOptions>) => import("node:stream").Transform;
|
|
6
6
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from '../../../types';
|
|
2
|
+
export declare function createNativeGulpPlugins(options?: UserDefinedOptions): {
|
|
3
|
+
transformWxss: (options?: Partial<IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
|
+
transformWxml: (options?: Partial<ITemplateHandlerOptions>) => import("node:stream").Transform;
|
|
5
|
+
transformJs: (options?: Partial<CreateJsHandlerOptions>) => import("node:stream").Transform;
|
|
6
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OutputAsset } from 'rollup';
|
|
2
2
|
import type { Plugin, ResolvedConfig } from 'vite';
|
|
3
|
+
import type { ViteFrameworkCssPipelineStrategy } from './shared/framework-strategy';
|
|
3
4
|
import type { TailwindSourceEntry } from '../../tailwindcss/source-scan';
|
|
4
5
|
import type { InternalUserDefinedOptions } from '../../types';
|
|
5
6
|
interface RememberedMainCssSource {
|
|
@@ -13,6 +14,7 @@ interface CssFinalizerContext {
|
|
|
13
14
|
readyPromise: Promise<void>;
|
|
14
15
|
};
|
|
15
16
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
17
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
16
18
|
isCssAssetProcessed: (asset: OutputAsset, file?: string) => boolean;
|
|
17
19
|
markCssAssetProcessed: (asset: OutputAsset, file?: string) => void;
|
|
18
20
|
debug: (format: string, ...args: unknown[]) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../shared/framework-strategy';
|
|
2
3
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
3
4
|
export declare function resolveCssBundleOutputFile(options: {
|
|
4
5
|
bundleFiles: string[];
|
|
@@ -6,6 +7,8 @@ export declare function resolveCssBundleOutputFile(options: {
|
|
|
6
7
|
file: string;
|
|
7
8
|
isWebGeneratorTarget: boolean;
|
|
8
9
|
opts: InternalUserDefinedOptions;
|
|
10
|
+
pipelineContext: ViteFrameworkCssPipelineContext;
|
|
11
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
9
12
|
shouldPreserveAppCssExtension: boolean;
|
|
10
13
|
}): string;
|
|
11
14
|
export declare function shouldSkipRawSourceStyleAsset(outputFile: string, file: string, rawSource: string, assetSourceFile?: string, cssMatcher?: ((file: string) => boolean) | undefined): boolean;
|
|
@@ -35,5 +38,6 @@ export declare function applyCssResultToBundle(options: {
|
|
|
35
38
|
outputFile: string;
|
|
36
39
|
source: string;
|
|
37
40
|
viteProcessedCssAsset: boolean;
|
|
38
|
-
|
|
41
|
+
pipelineContext: ViteFrameworkCssPipelineContext;
|
|
42
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
39
43
|
}): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
2
|
import type { BundleBuildState, BundleSnapshot } from '../bundle-state';
|
|
3
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../shared/framework-strategy';
|
|
3
4
|
import type { BundleMetrics } from './metrics';
|
|
4
5
|
import type { GenerateBundleContext } from './types';
|
|
5
6
|
interface FinalizeGenerateBundleOptions {
|
|
@@ -10,6 +11,8 @@ interface FinalizeGenerateBundleOptions {
|
|
|
10
11
|
bundleFiles: string[];
|
|
11
12
|
cache: GenerateBundleContext['opts']['cache'];
|
|
12
13
|
cssTaskFactories: Array<() => Promise<void>>;
|
|
14
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
15
|
+
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
13
16
|
debug: GenerateBundleContext['debug'];
|
|
14
17
|
defaultStyleOutputExtension: string;
|
|
15
18
|
formatIteration: number;
|
|
@@ -57,8 +60,9 @@ interface FinalizeGenerateBundleOptions {
|
|
|
57
60
|
transformWebTargetCss?: ((css: string, file: string) => string) | undefined;
|
|
58
61
|
useIncrementalMode: boolean;
|
|
59
62
|
}
|
|
60
|
-
export declare function
|
|
63
|
+
export declare function normalizeRootMiniProgramImportShellAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: Pick<GenerateBundleContext['opts'], 'cssMatcher'> & {
|
|
61
64
|
debug: GenerateBundleContext['debug'];
|
|
65
|
+
enabled: boolean;
|
|
62
66
|
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
63
67
|
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
64
68
|
}): number;
|
|
@@ -2,5 +2,5 @@ export declare function isRootMiniProgramStyleOutputFile(file: string): boolean;
|
|
|
2
2
|
export declare function createRelativeCssImportRequest(targetFile: string, importedFile: string): string;
|
|
3
3
|
export declare function createCssImportShell(targetFile: string, importedFile: string): string;
|
|
4
4
|
export declare function createRootMiniProgramOriginStyleOutputFile(file: string): string;
|
|
5
|
-
export declare function shouldKeepRootMiniProgramStyleAsImportShell(
|
|
6
|
-
export declare function shouldMoveRootMiniProgramStyleToImportShellOrigin(
|
|
5
|
+
export declare function shouldKeepRootMiniProgramStyleAsImportShell(enabled: boolean | undefined): enabled is true;
|
|
6
|
+
export declare function shouldMoveRootMiniProgramStyleToImportShellOrigin(enabled: boolean | undefined): enabled is true;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { OutputChunk } from 'rollup';
|
|
2
2
|
import type { BundleSnapshot } from '../bundle-state';
|
|
3
3
|
import type { RememberedCssSource } from './types';
|
|
4
|
+
export interface SfcStyleBlock {
|
|
5
|
+
attrs: string;
|
|
6
|
+
index: number;
|
|
7
|
+
scoped: boolean;
|
|
8
|
+
source: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function extractSfcStyleBlocks(source: string): SfcStyleBlock[];
|
|
4
11
|
export declare function extractSfcStyleSources(source: string): string[];
|
|
5
12
|
export declare function hasSfcStyleSources(source: string): boolean;
|
|
13
|
+
export declare function resolveSfcStyleRequestFromKnownSource(sourceFile: string, sfcSource: string | undefined, styleSource: string): string;
|
|
6
14
|
export declare function hasTailwindGenerationSource(source: string, options?: {
|
|
7
15
|
allowRootDirectives?: boolean | undefined;
|
|
8
16
|
}): boolean;
|
|
@@ -2,6 +2,7 @@ import type { OutputAsset } from 'rollup';
|
|
|
2
2
|
import type { ResolvedConfig } from 'vite';
|
|
3
3
|
import type { HmrTimingRecorder } from '../../shared/hmr-timing';
|
|
4
4
|
import type { BundleSnapshot } from '../bundle-state';
|
|
5
|
+
import type { ViteFrameworkCssPipelineStrategy } from '../shared/framework-strategy';
|
|
5
6
|
import type { SourceCandidateFilterOptions } from '../source-candidates';
|
|
6
7
|
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
7
8
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
@@ -58,6 +59,7 @@ export interface GenerateBundleContext {
|
|
|
58
59
|
}) => void;
|
|
59
60
|
getViteCssCacheStats?: () => Record<string, unknown>;
|
|
60
61
|
hmrTimingRecorder?: HmrTimingRecorder;
|
|
62
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
61
63
|
}
|
|
62
64
|
export interface RememberedCssSource {
|
|
63
65
|
outputFile: string;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
+
import type { WeappTailwindcssVitePlugin } from './shared/create-framework-plugins';
|
|
1
2
|
import type { UserDefinedOptions } from '../../types';
|
|
2
|
-
export
|
|
3
|
-
name: string;
|
|
4
|
-
[hook: string]: any;
|
|
5
|
-
}
|
|
3
|
+
export type { WeappTailwindcssVitePlugin } from './shared/create-framework-plugins';
|
|
6
4
|
export declare function WeappTailwindcss(options?: UserDefinedOptions): WeappTailwindcssVitePlugin[] | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OutputAsset, OutputBundle } from 'rollup';
|
|
2
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from './shared/framework-strategy';
|
|
2
3
|
import type { InternalUserDefinedOptions } from '../../types';
|
|
3
4
|
interface CssAssetMarkerMatcher {
|
|
4
5
|
(asset: OutputAsset, file?: string): boolean;
|
|
@@ -22,6 +23,8 @@ interface CssAssetResultsGetter {
|
|
|
22
23
|
}
|
|
23
24
|
interface CollectViteProcessedCssAssetOptions {
|
|
24
25
|
opts?: InternalUserDefinedOptions | undefined;
|
|
26
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
27
|
+
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
25
28
|
isViteProcessedCssAsset?: CssAssetMarkerMatcher | undefined;
|
|
26
29
|
markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
|
|
27
30
|
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
@@ -33,6 +36,8 @@ interface CollectViteProcessedCssAssetOptions {
|
|
|
33
36
|
}
|
|
34
37
|
interface InjectViteProcessedCssAssetOptions {
|
|
35
38
|
opts: InternalUserDefinedOptions;
|
|
39
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
40
|
+
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
|
|
36
41
|
getViteProcessedCssAssetResults?: CssAssetResultsGetter | undefined;
|
|
37
42
|
markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
|
|
38
43
|
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Plugin, ResolvedConfig } from 'vite';
|
|
2
|
+
import type { ViteFrameworkName } from '../../framework-selector';
|
|
3
|
+
import type { ViteFrameworkCssPipelineStrategy, ViteFrameworkExtraPluginPlatform, ViteFrameworkRuntimeFeatureContext } from './framework-strategy';
|
|
4
|
+
import type { ViteStyleInjectorDelegateFactory } from '../../../style-injector/internal';
|
|
5
|
+
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
6
|
+
import { getCompilerContext } from '../../../context';
|
|
7
|
+
import { toCustomAttributesEntities } from '../../../context/custom-attributes';
|
|
8
|
+
import { createViteRuntimeClassSet } from '../runtime-class-set';
|
|
9
|
+
export interface WeappTailwindcssVitePlugin {
|
|
10
|
+
name: string;
|
|
11
|
+
[hook: string]: any;
|
|
12
|
+
}
|
|
13
|
+
export interface ViteFrameworkBranchContext {
|
|
14
|
+
frameworkName: ViteFrameworkName;
|
|
15
|
+
createExtraPlugins?: (context: ViteFrameworkExtraPluginContext) => Plugin[];
|
|
16
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
17
|
+
getExtraPluginPlatform?: () => ViteFrameworkExtraPluginPlatform;
|
|
18
|
+
styleInjectorDelegate: ViteStyleInjectorDelegateFactory;
|
|
19
|
+
isRuntimeClassSetFeatureEnabled?: (context: ViteFrameworkRuntimeFeatureContext) => boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ViteFrameworkExtraPluginContext {
|
|
22
|
+
customAttributesEntities: ReturnType<typeof toCustomAttributesEntities>;
|
|
23
|
+
disabledDefaultTemplateHandler: boolean | undefined;
|
|
24
|
+
ensureRuntimeClassSet: (...args: any[]) => Promise<Set<string>>;
|
|
25
|
+
generateCss: (...args: any[]) => Promise<string | undefined>;
|
|
26
|
+
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
27
|
+
isEnabled: () => boolean;
|
|
28
|
+
isIosPlatform: boolean;
|
|
29
|
+
jsHandler: ReturnType<typeof getCompilerContext>['jsHandler'];
|
|
30
|
+
mainCssChunkMatcher: ReturnType<typeof getCompilerContext>['mainCssChunkMatcher'];
|
|
31
|
+
runtimeState: ReturnType<typeof createViteRuntimeClassSet>['runtimeState'];
|
|
32
|
+
styleHandler: ReturnType<typeof getCompilerContext>['styleHandler'];
|
|
33
|
+
uniAppX: ReturnType<typeof getCompilerContext>['uniAppX'];
|
|
34
|
+
}
|
|
35
|
+
export declare function createViteFrameworkPlugins(options: (UserDefinedOptions | InternalUserDefinedOptions) | undefined, frameworkBranch: ViteFrameworkBranchContext): WeappTailwindcssVitePlugin[] | undefined;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { OutputBundle } from 'rollup';
|
|
2
|
+
import type { ResolvedConfig } from 'vite';
|
|
3
|
+
import type { getCompilerContext } from '../../../context';
|
|
4
|
+
import type { normalizeWeappTailwindcssGeneratorOptions } from '../../../generator';
|
|
5
|
+
import type { resolveGeneratorRuntimeBranch } from '../../../runtime-branch';
|
|
6
|
+
import type { CreateJsHandlerOptions, InternalUserDefinedOptions } from '../../../types';
|
|
7
|
+
export interface ViteFrameworkExtraPluginPlatform {
|
|
8
|
+
isIosPlatform?: boolean | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface ViteFrameworkRuntimeFeatureContext {
|
|
11
|
+
uniAppX: ReturnType<typeof getCompilerContext>['uniAppX'];
|
|
12
|
+
}
|
|
13
|
+
export interface ViteFrameworkCssPipelineContext {
|
|
14
|
+
bundle?: OutputBundle | undefined;
|
|
15
|
+
currentGeneratorBranch: ReturnType<typeof resolveGeneratorRuntimeBranch>;
|
|
16
|
+
currentGeneratorOptions: ReturnType<typeof normalizeWeappTailwindcssGeneratorOptions>;
|
|
17
|
+
opts: InternalUserDefinedOptions;
|
|
18
|
+
resolvedConfig: ResolvedConfig | undefined;
|
|
19
|
+
resolveStylePlatform: () => string | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface ViteFrameworkCssPipelineStrategy {
|
|
22
|
+
getCssHandlerExtraOptions?: (context: ViteFrameworkCssPipelineContext & {
|
|
23
|
+
file: string;
|
|
24
|
+
}) => Record<string, unknown>;
|
|
25
|
+
getServeJsHandlerOptions?: (context: ViteFrameworkCssPipelineContext & {
|
|
26
|
+
file: string;
|
|
27
|
+
}) => CreateJsHandlerOptions | undefined;
|
|
28
|
+
includeTailwindGeneratedCssAssetsInRootCoverage?: (context: ViteFrameworkCssPipelineContext & {
|
|
29
|
+
bundleFiles: string[];
|
|
30
|
+
isWebGeneratorTarget: boolean;
|
|
31
|
+
outDir: string;
|
|
32
|
+
}) => boolean;
|
|
33
|
+
isHarmonyAppStyleTarget?: (context: ViteFrameworkCssPipelineContext) => boolean;
|
|
34
|
+
isNativeAppStyleTarget?: (context: ViteFrameworkCssPipelineContext) => boolean;
|
|
35
|
+
resolveConfiguredCssEntryRootInjectionTarget?: (context: ViteFrameworkCssPipelineContext & {
|
|
36
|
+
bundle: OutputBundle;
|
|
37
|
+
isConfiguredCssEntryFile: (file: string | undefined) => boolean;
|
|
38
|
+
isMiniProgramStyleOutputFile: (file: string) => boolean;
|
|
39
|
+
isRootStyleOutputFile: (file: string) => boolean;
|
|
40
|
+
outputFile: string;
|
|
41
|
+
sourceFile: string | undefined;
|
|
42
|
+
}) => string | undefined;
|
|
43
|
+
shouldApplyFinalWebviewCssCompat?: (context: ViteFrameworkCssPipelineContext & {
|
|
44
|
+
bundleFiles: string[];
|
|
45
|
+
isWebGeneratorTarget: boolean;
|
|
46
|
+
outDir: string;
|
|
47
|
+
}) => boolean;
|
|
48
|
+
shouldApplyWebCssCompat?: (context: ViteFrameworkCssPipelineContext) => boolean;
|
|
49
|
+
shouldDeferEmptyScopedCssSource?: (context: ViteFrameworkCssPipelineContext & {
|
|
50
|
+
cssHandlerOptions: {
|
|
51
|
+
isMainChunk?: boolean | undefined;
|
|
52
|
+
};
|
|
53
|
+
generatorCode: string;
|
|
54
|
+
}) => boolean;
|
|
55
|
+
shouldKeepRootMiniProgramStyleAsImportShell?: (context: ViteFrameworkCssPipelineContext & {
|
|
56
|
+
css: string;
|
|
57
|
+
file: string;
|
|
58
|
+
}) => boolean;
|
|
59
|
+
shouldMoveRootMiniProgramStyleToImportShellOrigin?: (context: ViteFrameworkCssPipelineContext & {
|
|
60
|
+
file: string;
|
|
61
|
+
}) => boolean;
|
|
62
|
+
shouldNormalizeRootMiniProgramImportShell?: (context: ViteFrameworkCssPipelineContext) => boolean;
|
|
63
|
+
shouldPreferExplicitWebCssTargets?: (context: ViteFrameworkCssPipelineContext & {
|
|
64
|
+
explicitRootTargets: string[];
|
|
65
|
+
explicitWebCssTargets: string[];
|
|
66
|
+
file: string;
|
|
67
|
+
}) => boolean;
|
|
68
|
+
shouldPreferMatchedRootWebOutputTarget?: (context: ViteFrameworkCssPipelineContext & {
|
|
69
|
+
file: string;
|
|
70
|
+
matchedRootWebOutputTargets: string[];
|
|
71
|
+
}) => boolean;
|
|
72
|
+
shouldPreserveStyleOutputExtension?: (context: ViteFrameworkCssPipelineContext) => boolean;
|
|
73
|
+
shouldSelectConfiguredCssEntryRootSource?: (context: ViteFrameworkCssPipelineContext & {
|
|
74
|
+
isRootStyleOutputFile: (file: string) => boolean;
|
|
75
|
+
outputFile: string;
|
|
76
|
+
}) => boolean;
|
|
77
|
+
shouldRemoveDuplicateUnlinkedRootCssAssetsReferencedByHtml?: (context: ViteFrameworkCssPipelineContext & {
|
|
78
|
+
bundleFiles: string[];
|
|
79
|
+
isWebGeneratorTarget: boolean;
|
|
80
|
+
outDir: string;
|
|
81
|
+
}) => boolean;
|
|
82
|
+
shouldTransformServeJs?: (context: ViteFrameworkCssPipelineContext) => boolean;
|
|
83
|
+
transformGeneratedCss?: (css: string, context: ViteFrameworkCssPipelineContext & {
|
|
84
|
+
defaultWebCssCompat: (css: string) => string;
|
|
85
|
+
removeScopedPreflight: (css: string) => string;
|
|
86
|
+
shouldApplyWebCssCompat: boolean;
|
|
87
|
+
}) => string;
|
|
88
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { AppType } from '../../../types';
|
|
2
1
|
export declare function getCacheKey(filename: string): string;
|
|
3
2
|
export declare function stripResourceQuery(resource?: string): string | undefined;
|
|
4
|
-
export declare function isCssLikeModuleResource(resource: string | undefined, cssMatcher: (file: string) => boolean
|
|
3
|
+
export declare function isCssLikeModuleResource(resource: string | undefined, cssMatcher: (file: string) => boolean): boolean;
|
|
5
4
|
export declare function hasLoaderEntry(entries: Array<{
|
|
6
5
|
loader?: string;
|
|
7
6
|
}>, target?: string): boolean;
|
|
@@ -28,6 +28,7 @@ export interface WebpackSourceCandidateCache {
|
|
|
28
28
|
export declare function isRuntimeTransformCandidate(candidate: string): boolean;
|
|
29
29
|
export declare function collectRuntimeTokenSignatureParts(source: string): [] | RegExpMatchArray;
|
|
30
30
|
export declare function hasMissingRuntimeCandidates(classSet: ReadonlySet<string> | undefined, candidates: ReadonlySet<string> | undefined): boolean;
|
|
31
|
+
export declare function hasStaleRuntimeCandidates(classSet: ReadonlySet<string> | undefined, candidates: ReadonlySet<string> | undefined): boolean;
|
|
31
32
|
export declare function resolveGeneratedCssRuntimeCandidates(source: string, fallbackClassSet?: ReadonlySet<string> | undefined): ReadonlySet<string>;
|
|
32
33
|
export declare function getRuntimeClassSetSync(tailwindRuntime: TailwindcssRuntimeLike): Set<string>;
|
|
33
34
|
export declare function toMb(bytes: number): number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TailwindV4CssSource } from '@tailwindcss-mangle/engine';
|
|
2
2
|
import type { Compiler } from 'webpack';
|
|
3
3
|
import type { WebpackCssSourceRegistration, WebpackGeneratedCssRegistration } from '../loaders/runtime-registry';
|
|
4
|
+
import type { LoaderAnchorFinders } from '../shared/loader-anchors';
|
|
4
5
|
import type { TailwindRuntimeState } from '../../../tailwindcss/runtime';
|
|
5
6
|
import type { AppType, InternalUserDefinedOptions } from '../../../types';
|
|
6
7
|
interface SetupWebpackV5LoadersOptions {
|
|
@@ -22,6 +23,8 @@ interface SetupWebpackV5LoadersOptions {
|
|
|
22
23
|
files: ReadonlySet<string>;
|
|
23
24
|
contexts: ReadonlySet<string>;
|
|
24
25
|
};
|
|
26
|
+
loaderAnchorFinders?: LoaderAnchorFinders | undefined;
|
|
27
|
+
mpxCssImportRewrite?: boolean | undefined;
|
|
25
28
|
runtimeRegistryKey?: string | undefined;
|
|
26
29
|
debug: (format: string, ...args: unknown[]) => void;
|
|
27
30
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Compiler } from 'webpack';
|
|
2
2
|
import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
3
|
-
export
|
|
3
|
+
export { weappTailwindcssPackageDir } from '../shared/create-framework-plugin';
|
|
4
4
|
export declare class WeappTailwindcss implements IBaseWebpackPlugin {
|
|
5
5
|
options: InternalUserDefinedOptions;
|
|
6
6
|
appType?: AppType;
|
|
7
|
-
private hasInitialTailwindCssRoots;
|
|
8
7
|
constructor(options?: UserDefinedOptions);
|
|
9
8
|
apply(compiler: Compiler): void;
|
|
10
9
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
2
|
+
import { WebpackFrameworkPlugin } from '../../shared/create-framework-plugin';
|
|
3
|
+
export declare class GenericWebpackPlugin extends WebpackFrameworkPlugin {
|
|
4
|
+
constructor(options?: UserDefinedOptions | InternalUserDefinedOptions);
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WebpackFrameworkName } from '../../framework-selector';
|
|
2
|
+
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
3
|
+
import { GenericWebpackPlugin } from './generic';
|
|
4
|
+
import { MpxWebpackPlugin } from './mpx';
|
|
5
|
+
import { TaroWebpackPlugin } from './taro';
|
|
6
|
+
import { UniAppWebpackPlugin } from './uni-app';
|
|
7
|
+
import { WeappViteWebpackPlugin } from './weapp-vite';
|
|
8
|
+
export declare function createWebpackFrameworkPlugin(frameworkName: WebpackFrameworkName, options?: UserDefinedOptions | InternalUserDefinedOptions): GenericWebpackPlugin | MpxWebpackPlugin | TaroWebpackPlugin | UniAppWebpackPlugin | WeappViteWebpackPlugin;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
2
|
+
import { WebpackFrameworkPlugin } from '../../shared/create-framework-plugin';
|
|
3
|
+
export declare class MpxWebpackPlugin extends WebpackFrameworkPlugin {
|
|
4
|
+
constructor(options?: UserDefinedOptions | InternalUserDefinedOptions);
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
2
|
+
import { WebpackFrameworkPlugin } from '../../shared/create-framework-plugin';
|
|
3
|
+
export declare class TaroWebpackPlugin extends WebpackFrameworkPlugin {
|
|
4
|
+
constructor(options?: UserDefinedOptions | InternalUserDefinedOptions);
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
2
|
+
import { WebpackFrameworkPlugin } from '../../shared/create-framework-plugin';
|
|
3
|
+
export declare class UniAppWebpackPlugin extends WebpackFrameworkPlugin {
|
|
4
|
+
constructor(options?: UserDefinedOptions | InternalUserDefinedOptions);
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
2
|
+
import { WebpackFrameworkPlugin } from '../../shared/create-framework-plugin';
|
|
3
|
+
export declare class WeappViteWebpackPlugin extends WebpackFrameworkPlugin {
|
|
4
|
+
constructor(options?: UserDefinedOptions | InternalUserDefinedOptions);
|
|
5
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack';
|
|
2
|
+
import type { WebpackFrameworkName } from '../../framework-selector';
|
|
3
|
+
import type { LoaderAnchorFinders } from '../shared/loader-anchors';
|
|
4
|
+
import type { WebpackStyleInjectorDelegateFactory } from '../../../style-injector/internal';
|
|
5
|
+
import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
6
|
+
export declare const weappTailwindcssPackageDir: string;
|
|
7
|
+
export interface WebpackFrameworkBranchContext {
|
|
8
|
+
frameworkName: WebpackFrameworkName;
|
|
9
|
+
loaderAnchorFinders: LoaderAnchorFinders;
|
|
10
|
+
mpxCssImportRewrite?: boolean | undefined;
|
|
11
|
+
setupCssImportRewriteRedirect?: ((packageDir: string) => void) | undefined;
|
|
12
|
+
styleInjectorDelegate: WebpackStyleInjectorDelegateFactory;
|
|
13
|
+
}
|
|
14
|
+
export declare class WebpackFrameworkPlugin implements IBaseWebpackPlugin {
|
|
15
|
+
options: InternalUserDefinedOptions;
|
|
16
|
+
appType?: AppType;
|
|
17
|
+
private hasInitialTailwindCssRoots;
|
|
18
|
+
private frameworkBranch;
|
|
19
|
+
constructor(options: (UserDefinedOptions | InternalUserDefinedOptions) | undefined, frameworkBranch: WebpackFrameworkBranchContext);
|
|
20
|
+
apply(compiler: Compiler): void;
|
|
21
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { AppType } from '../../../types';
|
|
2
1
|
export interface LoaderEntry {
|
|
3
2
|
loader?: string;
|
|
4
3
|
}
|
|
5
|
-
export
|
|
4
|
+
export interface LoaderAnchorFinders {
|
|
6
5
|
findRewriteAnchor: (entries: LoaderEntry[]) => number;
|
|
7
6
|
findClassSetAnchor: (entries: LoaderEntry[]) => number;
|
|
8
|
-
}
|
|
7
|
+
}
|
|
8
|
+
export declare function createMpxLoaderAnchorFinders(): LoaderAnchorFinders;
|
|
9
|
+
export declare function createDefaultLoaderAnchorFinders(): LoaderAnchorFinders;
|
package/dist/cli.js
CHANGED
|
@@ -300,6 +300,13 @@ let lastEscapedCandidateCacheStore;
|
|
|
300
300
|
function isUrlLikeCandidate(candidate) {
|
|
301
301
|
return candidate.startsWith("//") || candidate.startsWith("http://") || candidate.startsWith("https://");
|
|
302
302
|
}
|
|
303
|
+
function isPlainSlashPathCandidate(candidate) {
|
|
304
|
+
const slashIndex = candidate.indexOf("/");
|
|
305
|
+
if (slashIndex <= 0) return false;
|
|
306
|
+
if (isUrlLikeCandidate(candidate)) return true;
|
|
307
|
+
if (candidate.includes("[") || candidate.includes("]") || candidate.includes(":")) return false;
|
|
308
|
+
return !candidate.slice(0, slashIndex).includes("-");
|
|
309
|
+
}
|
|
303
310
|
function isArbitraryValueCandidate(candidate) {
|
|
304
311
|
let hasOpenBracket = false;
|
|
305
312
|
let hasCloseBracket = false;
|
|
@@ -355,6 +362,7 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
355
362
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
356
363
|
if (alwaysEscape) return DIRECT_RESULT;
|
|
357
364
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
365
|
+
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
358
366
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
359
367
|
if (classNameSet && classNameSet.size > 0) {
|
|
360
368
|
const escapedCandidate = getEscapedCandidate(candidate, escapeMap);
|
package/dist/cli.mjs
CHANGED
|
@@ -271,6 +271,13 @@ let lastEscapedCandidateCacheStore;
|
|
|
271
271
|
function isUrlLikeCandidate(candidate) {
|
|
272
272
|
return candidate.startsWith("//") || candidate.startsWith("http://") || candidate.startsWith("https://");
|
|
273
273
|
}
|
|
274
|
+
function isPlainSlashPathCandidate(candidate) {
|
|
275
|
+
const slashIndex = candidate.indexOf("/");
|
|
276
|
+
if (slashIndex <= 0) return false;
|
|
277
|
+
if (isUrlLikeCandidate(candidate)) return true;
|
|
278
|
+
if (candidate.includes("[") || candidate.includes("]") || candidate.includes(":")) return false;
|
|
279
|
+
return !candidate.slice(0, slashIndex).includes("-");
|
|
280
|
+
}
|
|
274
281
|
function isArbitraryValueCandidate(candidate) {
|
|
275
282
|
let hasOpenBracket = false;
|
|
276
283
|
let hasCloseBracket = false;
|
|
@@ -326,6 +333,7 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
326
333
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
327
334
|
if (alwaysEscape) return DIRECT_RESULT;
|
|
328
335
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
336
|
+
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
329
337
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
330
338
|
if (classNameSet && classNameSet.size > 0) {
|
|
331
339
|
const escapedCandidate = getEscapedCandidate(candidate, escapeMap);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
-
const require_v4_engine = require("./v4-engine-
|
|
4
|
-
const require_generator = require("./generator-
|
|
3
|
+
const require_v4_engine = require("./v4-engine-BZP2462H.js");
|
|
4
|
+
const require_generator = require("./generator-DaaFxR5V.js");
|
|
5
5
|
require("./utils-D3h8j7Mk.js");
|
|
6
6
|
const require_defaults = require("./defaults-nsf4VNMX.js");
|
|
7
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
7
|
+
const require_tailwindcss = require("./tailwindcss-BZjZZi60.js");
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
10
10
|
let node_process = require("node:process");
|
|
@@ -774,6 +774,13 @@ let lastEscapedCandidateCacheStore;
|
|
|
774
774
|
function isUrlLikeCandidate(candidate) {
|
|
775
775
|
return candidate.startsWith("//") || candidate.startsWith("http://") || candidate.startsWith("https://");
|
|
776
776
|
}
|
|
777
|
+
function isPlainSlashPathCandidate(candidate) {
|
|
778
|
+
const slashIndex = candidate.indexOf("/");
|
|
779
|
+
if (slashIndex <= 0) return false;
|
|
780
|
+
if (isUrlLikeCandidate(candidate)) return true;
|
|
781
|
+
if (candidate.includes("[") || candidate.includes("]") || candidate.includes(":")) return false;
|
|
782
|
+
return !candidate.slice(0, slashIndex).includes("-");
|
|
783
|
+
}
|
|
777
784
|
function isArbitraryValueCandidate(candidate) {
|
|
778
785
|
let hasOpenBracket = false;
|
|
779
786
|
let hasCloseBracket = false;
|
|
@@ -829,6 +836,7 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
829
836
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
830
837
|
if (alwaysEscape) return DIRECT_RESULT;
|
|
831
838
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
839
|
+
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
832
840
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
833
841
|
if (classNameSet && classNameSet.size > 0) {
|
|
834
842
|
const escapedCandidate = getEscapedCandidate(candidate, escapeMap);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { resolveMpxPlatform } from "./framework.mjs";
|
|
2
|
-
import { At as resolveValidTailwindV4Candidates$1, Et as omitUndefined, ct as createTailwindV4Engine$1, kt as loadTailwindV4DesignSystem, n as resolveTailwindV4SourceFromRuntime, wt as resolveCssMacroTailwindV4Source, y as resolveBooleanObjectOption } from "./v4-engine-
|
|
3
|
-
import { a as resolveGeneratorRuntimeBranch, i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-
|
|
2
|
+
import { At as resolveValidTailwindV4Candidates$1, Et as omitUndefined, ct as createTailwindV4Engine$1, kt as loadTailwindV4DesignSystem, n as resolveTailwindV4SourceFromRuntime, wt as resolveCssMacroTailwindV4Source, y as resolveBooleanObjectOption } from "./v4-engine-CjjWONB0.mjs";
|
|
3
|
+
import { a as resolveGeneratorRuntimeBranch, i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-DugIHBgl.mjs";
|
|
4
4
|
import { i as isMap, n as defuOverrideArray } from "./utils-DodxWHGz.mjs";
|
|
5
5
|
import { a as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, i as resolveDefaultCssPreflight, o as HARD_PARSE_CACHE_MAX_ENTRIES, r as getDefaultOptions } from "./defaults-9B6aMyZb.mjs";
|
|
6
|
-
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-
|
|
6
|
+
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-PA2jHHpx.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import process from "node:process";
|
|
@@ -766,6 +766,13 @@ let lastEscapedCandidateCacheStore;
|
|
|
766
766
|
function isUrlLikeCandidate(candidate) {
|
|
767
767
|
return candidate.startsWith("//") || candidate.startsWith("http://") || candidate.startsWith("https://");
|
|
768
768
|
}
|
|
769
|
+
function isPlainSlashPathCandidate(candidate) {
|
|
770
|
+
const slashIndex = candidate.indexOf("/");
|
|
771
|
+
if (slashIndex <= 0) return false;
|
|
772
|
+
if (isUrlLikeCandidate(candidate)) return true;
|
|
773
|
+
if (candidate.includes("[") || candidate.includes("]") || candidate.includes(":")) return false;
|
|
774
|
+
return !candidate.slice(0, slashIndex).includes("-");
|
|
775
|
+
}
|
|
769
776
|
function isArbitraryValueCandidate(candidate) {
|
|
770
777
|
let hasOpenBracket = false;
|
|
771
778
|
let hasCloseBracket = false;
|
|
@@ -821,6 +828,7 @@ function getEscapedCandidate(candidate, escapeMap, store = getEscapedCandidateCa
|
|
|
821
828
|
function resolveClassNameTransformWithResult(candidate, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext }) {
|
|
822
829
|
if (alwaysEscape) return DIRECT_RESULT;
|
|
823
830
|
if (jsPreserveClass?.(candidate)) return SKIP_RESULT;
|
|
831
|
+
if (!classContext && isPlainSlashPathCandidate(candidate)) return SKIP_RESULT;
|
|
824
832
|
if (classNameSet?.has(candidate)) return DIRECT_RESULT;
|
|
825
833
|
if (classNameSet && classNameSet.size > 0) {
|
|
826
834
|
const escapedCandidate = getEscapedCandidate(candidate, escapeMap);
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_context = require("./context-
|
|
2
|
+
const require_context = require("./context-CRhUs_5e.js");
|
|
3
3
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
4
4
|
//#region src/core.ts
|
|
5
5
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as ensureRuntimeClassSet, l as shouldSkipJsTransform, t as getCompilerContext, y as createTailwindRuntimeReadyPromise } from "./context-
|
|
1
|
+
import { b as ensureRuntimeClassSet, l as shouldSkipJsTransform, t as getCompilerContext, y as createTailwindRuntimeReadyPromise } from "./context-CfXr3hWz.mjs";
|
|
2
2
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
3
3
|
//#region src/core.ts
|
|
4
4
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|