weapp-tailwindcss 5.3.5 → 5.4.0
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.md +3 -3
- package/README.zh-CN.md +4 -4
- package/dist/bundlers/shared/framework-postcss.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/types.d.ts +3 -1
- package/dist/bundlers/shared/source-candidates/snapshot.d.ts +19 -0
- package/dist/bundlers/shared/source-candidates/source-priority.d.ts +1 -0
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -0
- package/dist/bundlers/shared/source-candidates/views.d.ts +12 -0
- package/dist/bundlers/shared/style-requests.d.ts +1 -0
- package/dist/bundlers/vite/bundle-state.d.ts +9 -1
- package/dist/bundlers/vite/capability-profile.d.ts +18 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +12 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +2 -2
- package/dist/bundlers/vite/shared/configured-css-entry-observer.d.ts +29 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +8 -0
- package/dist/bundlers/vite/shared/framework-css-generation-queue.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-hmr-module-version.d.ts +9 -0
- package/dist/bundlers/vite/shared/framework-runtime-utils.d.ts +5 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +12 -2
- package/dist/compiler/compilation-session-pool.d.ts +1 -0
- package/dist/compiler/framework-compiler-session.d.ts +21 -0
- package/dist/compiler/index.d.ts +1 -0
- package/dist/{context-DTLRADfE.cjs → compiler-C93NfxSe.cjs} +859 -11
- package/dist/{context-4ittVpgt.js → compiler-qDa3phIv.js} +764 -5
- package/dist/context/handlers.d.ts +1 -1
- package/dist/core/compiler/compiler.d.ts +2 -0
- package/dist/core/compiler/generation-cache.d.ts +30 -0
- package/dist/core/compiler/generation-state.d.ts +17 -0
- package/dist/core/compiler/index.d.ts +2 -0
- package/dist/core/compiler/root-store.d.ts +38 -0
- package/dist/core/compiler/snapshot.d.ts +35 -0
- package/dist/core/compiler/source-fingerprint.d.ts +3 -0
- package/dist/core/compiler/transforms.d.ts +15 -0
- package/dist/core/compiler/types.d.ts +69 -0
- package/dist/core.cjs +9 -8
- package/dist/core.d.ts +2 -1
- package/dist/core.js +2 -2
- package/dist/framework/index.d.ts +3 -1
- package/dist/framework.cjs +6 -1
- package/dist/framework.js +6 -1
- package/dist/{generator-EnTXLBlK.js → generator-C0m2S4WI.js} +3 -2
- package/dist/{generator-DKiYbTFR.cjs → generator-CKJ6sj1f.cjs} +3 -2
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-CUysZjW3.cjs → gulp-CW6JGqVn.cjs} +14 -16
- package/dist/{gulp-DwtrU4V1.js → gulp-e2iWsmEK.js} +7 -7
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-utmOgn6p.js → hmr-timing-DgMgwSce.js} +367 -289
- package/dist/{hmr-timing-Cvh5UgnM.cjs → hmr-timing-n7QQKFp7.cjs} +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{pipeline-helpers-CyVXL3h6.cjs → pipeline-helpers-DoLQy44Q.cjs} +6 -6
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -3
- package/dist/presets.js +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +2 -2
- package/dist/{source-candidate-scan-signature-CDrLxVKu.js → source-candidate-scan-signature-B0lOMiwB.js} +3 -3
- package/dist/{source-candidate-scan-signature-BNt7NrrI.cjs → source-candidate-scan-signature-Chb-Zrwt.cjs} +5 -5
- package/dist/{tailwindcss-CexDJBhx.cjs → tailwindcss-BGlJ1m1l.cjs} +763 -5
- package/dist/{tailwindcss-ChnpCv25.js → tailwindcss-BSKl0FTD.js} +1 -1
- package/dist/{transform-AfnwH_yx.cjs → transform-C6k9zTQR.cjs} +16 -7
- package/dist/{transform-BMPNt_vj.js → transform-DQhgAarN.js} +16 -7
- package/dist/typedoc.export.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/uni-app-x/component-local-style.d.ts +2 -0
- package/dist/uni-app-x/transform.d.ts +1 -0
- package/dist/uni-app-x/vite/asset-task.d.ts +21 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +8 -0
- package/dist/uni-app-x/vite/web-local-style.d.ts +2 -1
- package/dist/uni-app-x/vite.d.ts +1 -21
- package/dist/{v4-generation-core-Dhsu9Deu.cjs → v4-generation-core-B2sUkkgq.cjs} +378 -300
- package/dist/{vite-qxEVovZD.cjs → vite-B0IPgrvM.cjs} +807 -200
- package/dist/{vite-mWyHvLB0.js → vite-CcEb2SOl.js} +774 -165
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +7 -7
- package/dist/{webpack-Cpy_yggg.cjs → webpack-B5vc13U_.cjs} +33 -35
- package/dist/{webpack-CzhrD9p3.js → webpack-BPA5I79o.js} +7 -7
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/wxml/utils.d.ts +1 -1
- package/dist/{wxml-B7OAVpXJ.js → wxml-CvKyV69S.js} +10 -2
- package/dist/{wxml-PrK-8ARX.cjs → wxml-o-CUulAM.cjs} +40 -32
- package/package.json +12 -11
- package/dist/options-BJrtIQbH.cjs +0 -768
- package/dist/style-options-DW30H5PV.cjs +0 -82
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as findWorkspacePackageDir, D as resolveTailwindcssOptions, Dt as resolveCssSourceEntries, E as normalizeTailwindcssRuntimeOptions, Et as parseConfigParam, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, O as normalizeStringListOption, S as findNearestPackageRoot, St as expandTailwindSourceEntries, T as normalizeExtendLengthUnits, Tt as normalizeLegacyContentEntries, b as isTailwindV4CssEntry, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveTailwindV4CssSourceBase, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as groupCssEntriesByBase, w as findWorkspaceRoot, x as normalizeCssEntries, xt as FULL_SOURCE_SCAN_PATTERN, y as guessBasedirFromEntries } from "./generator-
|
|
1
|
+
import { C as findWorkspacePackageDir, D as resolveTailwindcssOptions, Dt as resolveCssSourceEntries, E as normalizeTailwindcssRuntimeOptions, Et as parseConfigParam, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, O as normalizeStringListOption, S as findNearestPackageRoot, St as expandTailwindSourceEntries, T as normalizeExtendLengthUnits, Tt as normalizeLegacyContentEntries, b as isTailwindV4CssEntry, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveTailwindV4CssSourceBase, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as groupCssEntriesByBase, w as findWorkspaceRoot, x as normalizeCssEntries, xt as FULL_SOURCE_SCAN_PATTERN, y as guessBasedirFromEntries } from "./generator-C0m2S4WI.js";
|
|
2
2
|
import { t as omitUndefined } from "./object-B-8IHefx.js";
|
|
3
3
|
import { n as defuOverrideArray$1 } from "./utils-MVwpU07P.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
2
|
-
const require_wxml = require("./wxml-
|
|
2
|
+
const require_wxml = require("./wxml-o-CUulAM.cjs");
|
|
3
3
|
const require_local_style_matcher = require("./local-style-matcher-DRpFEu1s.cjs");
|
|
4
4
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
5
|
+
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
5
6
|
let _vue_compiler_dom = require("@vue/compiler-dom");
|
|
6
7
|
//#region src/uni-app-x/component-local-style-binding.ts
|
|
7
8
|
const OPTIONS_CLASS_SECTIONS = /* @__PURE__ */ new Set(["computed", "methods"]);
|
|
@@ -119,10 +120,11 @@ function extractLiteralValue(path) {
|
|
|
119
120
|
function createAlias(fileId, utility, index) {
|
|
120
121
|
return `wtu-${createStableHash(`${fileId}:${utility}`)}-${index.toString(36)}`;
|
|
121
122
|
}
|
|
122
|
-
function serializeApplyUtility(utility) {
|
|
123
|
-
|
|
123
|
+
function serializeApplyUtility(utility, options = {}) {
|
|
124
|
+
const importantSuffix = options.native ? _weapp_tailwindcss_postcss.UNI_APP_X_IMPORTANT_APPLY_MARKER : options.web ? "!" : "#{'!'}";
|
|
125
|
+
if (utility.startsWith("!") && !utility.startsWith("\\!")) return `${utility.slice(1)}${importantSuffix}`;
|
|
124
126
|
if (!utility.endsWith("!") || utility.endsWith("\\!")) return utility;
|
|
125
|
-
return `${utility.slice(0, -1)}
|
|
127
|
+
return `${utility.slice(0, -1)}${importantSuffix}`;
|
|
126
128
|
}
|
|
127
129
|
function isRuntimeCandidate(candidate, runtimeSet) {
|
|
128
130
|
if (!runtimeSet || runtimeSet.size === 0) return false;
|
|
@@ -291,7 +293,7 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
291
293
|
const localSelector = options.web ? `:global(.${alias})` : `.${alias}`;
|
|
292
294
|
const selector = this.deepUtilities.has(utility) ? `${localSelector}, :deep(.${alias})` : localSelector;
|
|
293
295
|
lines.push(`${selector} {`);
|
|
294
|
-
lines.push(` @apply ${serializeApplyUtility(utility)};`);
|
|
296
|
+
lines.push(` @apply ${serializeApplyUtility(utility, options)};`);
|
|
295
297
|
lines.push("}");
|
|
296
298
|
}
|
|
297
299
|
return `${lines.join("\n")}\n`;
|
|
@@ -439,6 +441,10 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
439
441
|
const matchCustomAttribute = require_wxml.createAttributeMatcher(customAttributesEntities);
|
|
440
442
|
const ms = new require_wxml.MagicString(code);
|
|
441
443
|
const descriptor = parseSfc(code);
|
|
444
|
+
if (options.native || options.onWebLocalStyleRules) for (const style of descriptor.styles) {
|
|
445
|
+
const normalized = (0, _weapp_tailwindcss_postcss.normalizeUniAppXImportantApplyForSass)(style.content);
|
|
446
|
+
if (normalized !== style.content) ms.update(style.start, style.end, normalized);
|
|
447
|
+
}
|
|
442
448
|
const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
|
|
443
449
|
if (descriptor.errors.length === 0) {
|
|
444
450
|
if (descriptor.template?.ast) {
|
|
@@ -476,8 +482,11 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
476
482
|
if (scopedStyle && options.onWebLocalStyleRules) options.onWebLocalStyleRules(localStyleCollector.toStyleRules({ web: true }));
|
|
477
483
|
else if (scopedStyle) {
|
|
478
484
|
const separator = scopedStyle.content.endsWith("\n") ? "" : "\n";
|
|
479
|
-
ms.appendLeft(scopedStyle.end, `${separator}${localStyleCollector.toStyleRules()}`);
|
|
480
|
-
} else ms.append(`\n${localStyleCollector.toStyleBlock({
|
|
485
|
+
ms.appendLeft(scopedStyle.end, `${separator}${localStyleCollector.toStyleRules({ native: options.native })}`);
|
|
486
|
+
} else ms.append(`\n${localStyleCollector.toStyleBlock({
|
|
487
|
+
native: options.native || Boolean(options.onWebLocalStyleRules),
|
|
488
|
+
web: Boolean(options.onWebLocalStyleRules)
|
|
489
|
+
})}`);
|
|
481
490
|
}
|
|
482
491
|
}
|
|
483
492
|
const result = {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { n as _defineProperty } from "./object-B-8IHefx.js";
|
|
2
|
-
import { g as traverse$1, h as babelParse, i as analyzeSource, n as generateCode, o as JsTokenUpdater, p as replaceWxml, r as createAttributeMatcher, u as isClassContextLiteralPath } from "./wxml-
|
|
2
|
+
import { g as traverse$1, h as babelParse, i as analyzeSource, n as generateCode, o as JsTokenUpdater, p as replaceWxml, r as createAttributeMatcher, u as isClassContextLiteralPath } from "./wxml-CvKyV69S.js";
|
|
3
3
|
import { n as shouldEnableComponentLocalStyle, r as shouldEnablePageLocalStyle } from "./local-style-matcher-DsiI2wIc.js";
|
|
4
4
|
import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
5
|
+
import { UNI_APP_X_IMPORTANT_APPLY_MARKER, normalizeUniAppXImportantApplyForSass } from "@weapp-tailwindcss/postcss";
|
|
5
6
|
import MagicString from "magic-string";
|
|
6
7
|
import { NodeTypes, parse } from "@vue/compiler-dom";
|
|
7
8
|
//#region src/uni-app-x/component-local-style-binding.ts
|
|
@@ -120,10 +121,11 @@ function extractLiteralValue(path) {
|
|
|
120
121
|
function createAlias(fileId, utility, index) {
|
|
121
122
|
return `wtu-${createStableHash(`${fileId}:${utility}`)}-${index.toString(36)}`;
|
|
122
123
|
}
|
|
123
|
-
function serializeApplyUtility(utility) {
|
|
124
|
-
|
|
124
|
+
function serializeApplyUtility(utility, options = {}) {
|
|
125
|
+
const importantSuffix = options.native ? UNI_APP_X_IMPORTANT_APPLY_MARKER : options.web ? "!" : "#{'!'}";
|
|
126
|
+
if (utility.startsWith("!") && !utility.startsWith("\\!")) return `${utility.slice(1)}${importantSuffix}`;
|
|
125
127
|
if (!utility.endsWith("!") || utility.endsWith("\\!")) return utility;
|
|
126
|
-
return `${utility.slice(0, -1)}
|
|
128
|
+
return `${utility.slice(0, -1)}${importantSuffix}`;
|
|
127
129
|
}
|
|
128
130
|
function isRuntimeCandidate(candidate, runtimeSet) {
|
|
129
131
|
if (!runtimeSet || runtimeSet.size === 0) return false;
|
|
@@ -292,7 +294,7 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
292
294
|
const localSelector = options.web ? `:global(.${alias})` : `.${alias}`;
|
|
293
295
|
const selector = this.deepUtilities.has(utility) ? `${localSelector}, :deep(.${alias})` : localSelector;
|
|
294
296
|
lines.push(`${selector} {`);
|
|
295
|
-
lines.push(` @apply ${serializeApplyUtility(utility)};`);
|
|
297
|
+
lines.push(` @apply ${serializeApplyUtility(utility, options)};`);
|
|
296
298
|
lines.push("}");
|
|
297
299
|
}
|
|
298
300
|
return `${lines.join("\n")}\n`;
|
|
@@ -440,6 +442,10 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
440
442
|
const matchCustomAttribute = createAttributeMatcher(customAttributesEntities);
|
|
441
443
|
const ms = new MagicString(code);
|
|
442
444
|
const descriptor = parseSfc(code);
|
|
445
|
+
if (options.native || options.onWebLocalStyleRules) for (const style of descriptor.styles) {
|
|
446
|
+
const normalized = normalizeUniAppXImportantApplyForSass(style.content);
|
|
447
|
+
if (normalized !== style.content) ms.update(style.start, style.end, normalized);
|
|
448
|
+
}
|
|
443
449
|
const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
|
|
444
450
|
if (descriptor.errors.length === 0) {
|
|
445
451
|
if (descriptor.template?.ast) {
|
|
@@ -477,8 +483,11 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
477
483
|
if (scopedStyle && options.onWebLocalStyleRules) options.onWebLocalStyleRules(localStyleCollector.toStyleRules({ web: true }));
|
|
478
484
|
else if (scopedStyle) {
|
|
479
485
|
const separator = scopedStyle.content.endsWith("\n") ? "" : "\n";
|
|
480
|
-
ms.appendLeft(scopedStyle.end, `${separator}${localStyleCollector.toStyleRules()}`);
|
|
481
|
-
} else ms.append(`\n${localStyleCollector.toStyleBlock({
|
|
486
|
+
ms.appendLeft(scopedStyle.end, `${separator}${localStyleCollector.toStyleRules({ native: options.native })}`);
|
|
487
|
+
} else ms.append(`\n${localStyleCollector.toStyleBlock({
|
|
488
|
+
native: options.native || Boolean(options.onWebLocalStyleRules),
|
|
489
|
+
web: Boolean(options.onWebLocalStyleRules)
|
|
490
|
+
})}`);
|
|
482
491
|
}
|
|
483
492
|
}
|
|
484
493
|
const result = {
|
package/dist/typedoc.export.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { Compiler, CompilerCacheReuseState, CompilerGenerateRequest, CompilerGenerateResult, CompilerSnapshot, CompilerSnapshotRoot, CompilerSourcePattern, CompilerTarget, CompilerTemplateTransformOptions, CreateCompilerOptions, CreateCompilerSnapshotRequest, } from './core.js';
|
|
1
2
|
export type { WeappTailwindcssGenerateOptions, WeappTailwindcssGenerateResult, WeappTailwindcssGenerator, WeappTailwindcssGeneratorTarget, WeappTailwindcssPostcssPluginOptions, } from './index.js';
|
|
2
3
|
export type { WeappTailwindcssStyleInjectorOptions } from './types/index.js';
|
|
3
4
|
export type { ApplyOptions, CacheOptions, ExtractOptions, TailwindCssOptions, TailwindCssRuntimeOptions, TailwindV4Options, } from './types/typedoc-tailwindcss-runtime.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export interface ICommonReplaceOptions {
|
|
|
70
70
|
escapeMap?: Record<string, string> | undefined;
|
|
71
71
|
}
|
|
72
72
|
export interface ITemplateHandlerOptions extends ICommonReplaceOptions {
|
|
73
|
+
classSetMode?: 'all' | 'exact' | undefined;
|
|
73
74
|
customAttributesEntities?: ICustomAttributesEntities | undefined;
|
|
74
75
|
escapeMap?: Record<string, string> | undefined;
|
|
75
76
|
inlineWxs?: boolean | undefined;
|
|
@@ -18,9 +18,11 @@ export declare class UniAppXComponentLocalStyleCollector {
|
|
|
18
18
|
rewriteTransformedCode(rawSource: string, options?: RewriteCodeOptions): string;
|
|
19
19
|
hasStyles(): boolean;
|
|
20
20
|
toStyleBlock(options?: {
|
|
21
|
+
native?: boolean;
|
|
21
22
|
web?: boolean;
|
|
22
23
|
}): string;
|
|
23
24
|
toStyleRules(options?: {
|
|
25
|
+
native?: boolean;
|
|
24
26
|
web?: boolean;
|
|
25
27
|
}): string;
|
|
26
28
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OutputAsset } from 'rollup';
|
|
2
|
+
import type { ICreateCacheReturnType } from '../../cache/index.js';
|
|
3
|
+
import type { CreateJsHandlerOptions, InternalUserDefinedOptions, JsHandler, LinkedJsModuleResult } from '../../types/index.js';
|
|
4
|
+
type ApplyLinkedResults = (linked: Record<string, LinkedJsModuleResult> | undefined) => void;
|
|
5
|
+
export interface CreateUniAppXAssetTaskOptions {
|
|
6
|
+
cache: ICreateCacheReturnType;
|
|
7
|
+
hashKey?: string;
|
|
8
|
+
hashSalt?: string;
|
|
9
|
+
createHandlerOptions: (absoluteFilename: string, extra?: CreateJsHandlerOptions) => CreateJsHandlerOptions;
|
|
10
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
11
|
+
jsHandler: JsHandler;
|
|
12
|
+
onUpdate: (filename: string, oldVal: string, newVal: string) => void;
|
|
13
|
+
runtimeSet: Set<string>;
|
|
14
|
+
applyLinkedResults: ApplyLinkedResults;
|
|
15
|
+
uniAppX?: InternalUserDefinedOptions['uniAppX'];
|
|
16
|
+
getAssetSource?: (file: string) => string | undefined;
|
|
17
|
+
getCssSources?: () => Iterable<string | undefined>;
|
|
18
|
+
injectStylePlaceholder?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function createUniAppXAssetTask(file: string, originalSource: OutputAsset, outDir: string, options: CreateUniAppXAssetTaskOptions): () => Promise<void>;
|
|
21
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HmrContext, ResolvedConfig } from 'vite';
|
|
2
|
+
import type { ViteHmrCssModuleVersionTracker } from '../../bundlers/vite/shared/framework-hmr-module-version.js';
|
|
2
3
|
import type { AppType, ICustomAttributesEntities, InternalUserDefinedOptions, JsHandler } from '../../types/index.js';
|
|
3
4
|
export interface CreateUniAppXPluginsOptions {
|
|
4
5
|
appType: AppType;
|
|
@@ -21,10 +22,17 @@ export interface CreateUniAppXPluginsOptions {
|
|
|
21
22
|
jsHandler: JsHandler;
|
|
22
23
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
23
24
|
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
25
|
+
hmrCssModuleVersions?: ViteHmrCssModuleVersionTracker | undefined;
|
|
24
26
|
isIosPlatform?: boolean;
|
|
25
27
|
isNativeAppStyleTarget?: (() => boolean) | undefined;
|
|
26
28
|
isWebGeneratorTarget?: (() => boolean) | undefined;
|
|
27
29
|
isEnabled?: (() => boolean) | undefined;
|
|
28
30
|
uniAppX?: InternalUserDefinedOptions['uniAppX'];
|
|
29
31
|
viteProcessedCssSourceFiles?: Iterable<string> | undefined;
|
|
32
|
+
webCssEntryDiagnostics?: {
|
|
33
|
+
dispose: () => void;
|
|
34
|
+
flush: () => void;
|
|
35
|
+
observeSourceImports: (source: string, sourceId: string) => void;
|
|
36
|
+
requestCheck: () => void;
|
|
37
|
+
} | undefined;
|
|
30
38
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HmrContext, ModuleNode } from 'vite';
|
|
2
|
-
|
|
2
|
+
import type { ViteHmrCssModuleVersionTracker } from '../../bundlers/vite/shared/framework-hmr-module-version.js';
|
|
3
|
+
export declare function createUniAppXWebLocalStyleBridge(isEnabled: () => boolean, hmrCssModuleVersions?: ViteHmrCssModuleVersionTracker): {
|
|
3
4
|
appendToStyle(code: string, id: string): string;
|
|
4
5
|
handleHotUpdate(ctx: HmrContext): ModuleNode[] | undefined;
|
|
5
6
|
remember(id: string, rules: string): void;
|
package/dist/uni-app-x/vite.d.ts
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import type { OutputAsset } from 'rollup';
|
|
2
1
|
import type { Plugin } from 'vite';
|
|
3
2
|
import type { CreateUniAppXPluginsOptions } from './vite/plugin-options.js';
|
|
4
|
-
|
|
5
|
-
import type { CreateJsHandlerOptions, InternalUserDefinedOptions, JsHandler, LinkedJsModuleResult } from '../types/index.js';
|
|
3
|
+
export { createUniAppXAssetTask } from './vite/asset-task.js';
|
|
6
4
|
export declare function createUniAppXPlugins(options: CreateUniAppXPluginsOptions): Plugin[];
|
|
7
|
-
type ApplyLinkedResults = (linked: Record<string, LinkedJsModuleResult> | undefined) => void;
|
|
8
|
-
interface CreateUniAppXAssetTaskOptions {
|
|
9
|
-
cache: ICreateCacheReturnType;
|
|
10
|
-
hashKey?: string;
|
|
11
|
-
hashSalt?: string;
|
|
12
|
-
createHandlerOptions: (absoluteFilename: string, extra?: CreateJsHandlerOptions) => CreateJsHandlerOptions;
|
|
13
|
-
debug: (format: string, ...args: unknown[]) => void;
|
|
14
|
-
jsHandler: JsHandler;
|
|
15
|
-
onUpdate: (filename: string, oldVal: string, newVal: string) => void;
|
|
16
|
-
runtimeSet: Set<string>;
|
|
17
|
-
applyLinkedResults: ApplyLinkedResults;
|
|
18
|
-
uniAppX?: InternalUserDefinedOptions['uniAppX'];
|
|
19
|
-
getAssetSource?: (file: string) => string | undefined;
|
|
20
|
-
getCssSources?: () => Iterable<string | undefined>;
|
|
21
|
-
injectStylePlaceholder?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export declare function createUniAppXAssetTask(file: string, originalSource: OutputAsset, outDir: string, options: CreateUniAppXAssetTaskOptions): () => Promise<void>;
|
|
24
|
-
export {};
|