weapp-tailwindcss 5.2.13 → 5.3.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 +55 -8
- package/README.zh-CN.md +64 -0
- package/dist/bundlers/rspack/rule-match.d.ts +13 -0
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +7 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-plugin-order.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +2 -2
- package/dist/{transform-BiHG42Rp.cjs → component-local-style-BirkN5f8.cjs} +33 -168
- package/dist/{transform-52FLRu-0.js → component-local-style-CFL4ClhS.js} +22 -174
- package/dist/generator/index.d.ts +2 -2
- package/dist/generator.cjs +7 -0
- package/dist/generator.js +2 -2
- package/dist/{gulp-DxKLSgXX.cjs → gulp-B0qcNiuP.cjs} +2 -2
- package/dist/{gulp-G--cGMcR.js → gulp-D1vDx4H1.js} +1 -1
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-iTua_Z55.js → hmr-timing-Dq1_msos.js} +19 -15
- package/dist/{hmr-timing-BtqnyxAO.cjs → hmr-timing-pF6k35pP.cjs} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/{pipeline-helpers-DnYpfbat.cjs → pipeline-helpers-DA5-EzbO.cjs} +1 -1
- package/dist/rspack.cjs +124 -7
- package/dist/rspack.js +124 -7
- package/dist/{source-candidate-scan-signature-Ggn8fzkT.cjs → source-candidate-scan-signature-DGQufJk3.cjs} +1 -1
- package/dist/{source-candidate-scan-signature-TKJIs7VF.js → source-candidate-scan-signature-DSsjYtlq.js} +1 -1
- package/dist/tailwindcss/candidates.d.ts +2 -2
- package/dist/transform-BYhgJszj.cjs +200 -0
- package/dist/transform-Ck31voUU.js +201 -0
- package/dist/uni-app-x/component-local-style.d.ts +3 -1
- package/dist/uni-app-x/transform.d.ts +2 -0
- package/dist/uni-app-x/vite/style-request.d.ts +1 -0
- package/dist/uni-app-x/vite/web-local-style.d.ts +6 -0
- package/dist/{v4-generation-core-D-zVR2mt.cjs → v4-generation-core-BEYGV4eB.cjs} +19 -15
- package/dist/{vite-B577QMUl.js → vite-DBgbFsei.js} +240 -82
- package/dist/{vite-BFWJAH16.cjs → vite-jftHIupF.cjs} +240 -82
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +2 -2
- package/dist/{webpack-DLJkStre.js → webpack-BSIWFzAA.js} +3 -3
- package/dist/{webpack-DTqFKvcE.cjs → webpack-DhwW2cva.cjs} +4 -4
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +9 -14
- package/README.en.md +0 -17
- package/bin/weapp-tailwindcss.cjs +0 -8
- package/dist/cli/context.d.ts +0 -3
- package/dist/cli/doctor/constants.d.ts +0 -7
- package/dist/cli/doctor/types.d.ts +0 -31
- package/dist/cli/doctor.d.ts +0 -4
- package/dist/cli/helpers/options/format.d.ts +0 -2
- package/dist/cli/helpers/options/parse.d.ts +0 -3
- package/dist/cli/helpers/options/resolve.d.ts +0 -1
- package/dist/cli/helpers/options.d.ts +0 -3
- package/dist/cli/helpers.d.ts +0 -4
- package/dist/cli/mount-options.d.ts +0 -4
- package/dist/cli/types.d.ts +0 -15
- package/dist/cli/vscode-entry.d.ts +0 -14
- package/dist/cli.cjs +0 -37065
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -2298
|
@@ -4,14 +4,15 @@ const require_generator = require("./generator-BXrWA7Sj.cjs");
|
|
|
4
4
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
5
|
const require_options = require("./options-DbYws6lr.cjs");
|
|
6
6
|
require("./utils-CuKLf1Zv.cjs");
|
|
7
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
7
|
+
const require_v4_generation_core = require("./v4-generation-core-BEYGV4eB.cjs");
|
|
8
8
|
const require_wxml = require("./wxml-CQmBCjOR.cjs");
|
|
9
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-pF6k35pP.cjs");
|
|
10
10
|
const require_context = require("./context-vWlNv-Cf.cjs");
|
|
11
11
|
const require_tailwindcss = require("./tailwindcss-D1M2xj5O.cjs");
|
|
12
12
|
const require_style_options = require("./style-options-Cta1OP3i.cjs");
|
|
13
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
13
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-DGQufJk3.cjs");
|
|
14
14
|
require("./logger-TlKT3xmR.cjs");
|
|
15
|
+
const require_component_local_style = require("./component-local-style-BirkN5f8.cjs");
|
|
15
16
|
const require_css_imports = require("./css-imports-BFMU7Hpd.cjs");
|
|
16
17
|
let node_fs = require("node:fs");
|
|
17
18
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
@@ -2820,6 +2821,47 @@ function restoreFrameworkRootMiniProgramImportShellAssets(bundle, options) {
|
|
|
2820
2821
|
});
|
|
2821
2822
|
return restored;
|
|
2822
2823
|
}
|
|
2824
|
+
function resolveRuntimeRootStyleOutputFile(bundle, matchesCss) {
|
|
2825
|
+
const rootChunks = Object.entries(bundle).flatMap(([bundleFile, output]) => {
|
|
2826
|
+
if (output.type !== "chunk") return [];
|
|
2827
|
+
const file = require_source_candidate_scan_signature.normalizeOutputPathKey(output.fileName || bundleFile);
|
|
2828
|
+
if (file.includes("/")) return [];
|
|
2829
|
+
return [{
|
|
2830
|
+
file,
|
|
2831
|
+
isEntry: output.isEntry === true
|
|
2832
|
+
}];
|
|
2833
|
+
});
|
|
2834
|
+
const entryChunks = rootChunks.filter((chunk) => chunk.isEntry);
|
|
2835
|
+
const rootChunkStems = new Set((entryChunks.length > 0 ? entryChunks : rootChunks).map((chunk) => node_path.default.posix.parse(chunk.file).name));
|
|
2836
|
+
const candidates = Object.entries(bundle).flatMap(([bundleFile, output]) => {
|
|
2837
|
+
if (output.type !== "asset") return [];
|
|
2838
|
+
const file = require_source_candidate_scan_signature.normalizeOutputPathKey(output.fileName || bundleFile);
|
|
2839
|
+
return isRootMiniProgramStyleOutputFile$1(file) && matchesCss(file) && rootChunkStems.has(node_path.default.posix.parse(file).name) ? [file] : [];
|
|
2840
|
+
});
|
|
2841
|
+
return candidates.length === 1 ? candidates[0] : void 0;
|
|
2842
|
+
}
|
|
2843
|
+
function linkFrameworkRootStyleToRuntimeEntry(bundle, options) {
|
|
2844
|
+
if (options.targetByFile.size === 0) return 0;
|
|
2845
|
+
const runtimeRootFile = resolveRuntimeRootStyleOutputFile(bundle, options.matchesCss);
|
|
2846
|
+
if (!runtimeRootFile) return 0;
|
|
2847
|
+
const frameworkRootFiles = [...options.targetByFile.keys()].filter((file) => require_source_candidate_scan_signature.normalizeOutputPathKey(file) !== require_source_candidate_scan_signature.normalizeOutputPathKey(runtimeRootFile) && isRootMiniProgramStyleOutputFile$1(file) && options.matchesCss(file));
|
|
2848
|
+
if (frameworkRootFiles.length !== 1) return 0;
|
|
2849
|
+
const frameworkRootFile = frameworkRootFiles[0];
|
|
2850
|
+
const runtimeOutput = Object.entries(bundle).find(([bundleFile, output]) => output.type === "asset" && require_source_candidate_scan_signature.normalizeOutputPathKey(output.fileName || bundleFile) === require_source_candidate_scan_signature.normalizeOutputPathKey(runtimeRootFile))?.[1];
|
|
2851
|
+
const frameworkOutput = Object.entries(bundle).find(([bundleFile, output]) => output.type === "asset" && require_source_candidate_scan_signature.normalizeOutputPathKey(output.fileName || bundleFile) === require_source_candidate_scan_signature.normalizeOutputPathKey(frameworkRootFile))?.[1];
|
|
2852
|
+
if (runtimeOutput?.type !== "asset" || frameworkOutput?.type !== "asset") return 0;
|
|
2853
|
+
const runtimeSource = runtimeOutput.source.toString();
|
|
2854
|
+
const importedRuntimeFile = resolveSingleCssImportOutputFile(runtimeRootFile, runtimeSource);
|
|
2855
|
+
if (importedRuntimeFile && require_source_candidate_scan_signature.normalizeOutputPathKey(importedRuntimeFile) === require_source_candidate_scan_signature.normalizeOutputPathKey(frameworkRootFile)) return 0;
|
|
2856
|
+
const importedFrameworkFile = resolveSingleCssImportOutputFile(frameworkRootFile, frameworkOutput.source.toString());
|
|
2857
|
+
if (importedFrameworkFile && require_source_candidate_scan_signature.normalizeOutputPathKey(importedFrameworkFile) === require_source_candidate_scan_signature.normalizeOutputPathKey(runtimeRootFile)) return 0;
|
|
2858
|
+
const nextSource = `${createCssImportShell$1(runtimeRootFile, frameworkRootFile)}${runtimeSource}`;
|
|
2859
|
+
runtimeOutput.source = nextSource;
|
|
2860
|
+
options.recordCssAssetResult?.(runtimeRootFile, nextSource);
|
|
2861
|
+
options.onUpdate?.(runtimeRootFile, runtimeSource, nextSource);
|
|
2862
|
+
options.debug?.("link framework root css to runtime entry: %s -> %s", runtimeRootFile, frameworkRootFile);
|
|
2863
|
+
return 1;
|
|
2864
|
+
}
|
|
2823
2865
|
function shouldMoveRootMiniProgramStyleToImportShellOrigin(enabled) {
|
|
2824
2866
|
return enabled === true;
|
|
2825
2867
|
}
|
|
@@ -6178,6 +6220,8 @@ const INLINE_LANG_RE = /lang\.([a-z]+)/i;
|
|
|
6178
6220
|
const PREPROCESSOR_EXT_RE = /\.(?:scss|sass|less|styl|stylus)(?:\?|$)/i;
|
|
6179
6221
|
const UVUE_NVUE_RE$1 = /\.(?:uvue|nvue)$/;
|
|
6180
6222
|
const CSS_MODULE_EXPORT_RE = /^\s*export\s+default\s+(?:\{|\w|\[\])/;
|
|
6223
|
+
const RELATIVE_REFERENCE_RE = /@reference\s+(["'])(\.\.?[\\/][^"']+)\1\s*;?/g;
|
|
6224
|
+
const WINDOWS_ABSOLUTE_PATH_RE = /^[a-z]:[\\/]/i;
|
|
6181
6225
|
function isPreprocessorRequest(id, lang) {
|
|
6182
6226
|
const normalizedLang = lang?.toLowerCase();
|
|
6183
6227
|
if (normalizedLang && preprocessorLangs.has(normalizedLang)) return true;
|
|
@@ -6191,6 +6235,15 @@ function resolveUniAppXCssTarget(id) {
|
|
|
6191
6235
|
function isCssModuleExport(code) {
|
|
6192
6236
|
return CSS_MODULE_EXPORT_RE.test(code);
|
|
6193
6237
|
}
|
|
6238
|
+
function normalizeRelativeTailwindReferences(code, id) {
|
|
6239
|
+
if (!code.includes("@reference")) return code;
|
|
6240
|
+
const sourceFile = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
6241
|
+
const pathApi = WINDOWS_ABSOLUTE_PATH_RE.test(sourceFile) ? node_path.default.win32 : node_path.default;
|
|
6242
|
+
const sourceDir = pathApi.dirname(sourceFile);
|
|
6243
|
+
return code.replace(RELATIVE_REFERENCE_RE, (_full, quote, request) => {
|
|
6244
|
+
return `@reference ${quote}${pathApi.resolve(sourceDir, request).replace(/\\/g, "/")}${quote};`;
|
|
6245
|
+
});
|
|
6246
|
+
}
|
|
6194
6247
|
function resolvePreprocessorTransform(code, id, lang, options) {
|
|
6195
6248
|
if (!isPreprocessorRequest(id, lang)) return;
|
|
6196
6249
|
if (options.isIosPlatform) {
|
|
@@ -6203,10 +6256,36 @@ function resolvePreprocessorTransform(code, id, lang, options) {
|
|
|
6203
6256
|
if (options.isWebGeneratorTarget && !options.isNativeAppStyleTarget) return { result: void 0 };
|
|
6204
6257
|
}
|
|
6205
6258
|
//#endregion
|
|
6259
|
+
//#region src/uni-app-x/vite/web-local-style.ts
|
|
6260
|
+
function isStyleModule(mod) {
|
|
6261
|
+
const request = mod.id ?? mod.url;
|
|
6262
|
+
return typeof request === "string" && /[?&](?:vue&)?type=style(?:&|$)/.test(request);
|
|
6263
|
+
}
|
|
6264
|
+
function createUniAppXWebLocalStyleBridge(isEnabled) {
|
|
6265
|
+
const rulesByFile = /* @__PURE__ */ new Map();
|
|
6266
|
+
return {
|
|
6267
|
+
appendToStyle(code, id) {
|
|
6268
|
+
if (!isEnabled()) return code;
|
|
6269
|
+
const rules = rulesByFile.get((0, _weapp_tailwindcss_shared.cleanUrl)(id));
|
|
6270
|
+
return rules ? `${code}\n${rules}` : code;
|
|
6271
|
+
},
|
|
6272
|
+
handleHotUpdate(ctx) {
|
|
6273
|
+
if (!isEnabled() || !/\.(?:uvue|nvue)$/i.test((0, _weapp_tailwindcss_shared.cleanUrl)(ctx.file))) return;
|
|
6274
|
+
const styleModules = [...ctx.server.moduleGraph.getModulesByFile?.(ctx.file) ?? []].filter(isStyleModule);
|
|
6275
|
+
if (styleModules.length === 0) return;
|
|
6276
|
+
for (const mod of styleModules) ctx.server.moduleGraph.invalidateModule(mod);
|
|
6277
|
+
return [.../* @__PURE__ */ new Set([...ctx.modules, ...styleModules])];
|
|
6278
|
+
},
|
|
6279
|
+
remember(id, rules) {
|
|
6280
|
+
rulesByFile.set((0, _weapp_tailwindcss_shared.cleanUrl)(id), rules);
|
|
6281
|
+
}
|
|
6282
|
+
};
|
|
6283
|
+
}
|
|
6284
|
+
//#endregion
|
|
6206
6285
|
//#region src/uni-app-x/vite.ts
|
|
6207
6286
|
let transformUVuePromise;
|
|
6208
6287
|
function loadTransformUVue() {
|
|
6209
|
-
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-
|
|
6288
|
+
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-BYhgJszj.cjs")).then((mod) => mod.transformUVue));
|
|
6210
6289
|
return transformUVuePromise;
|
|
6211
6290
|
}
|
|
6212
6291
|
const UVUE_NVUE_QUERY_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
@@ -6221,6 +6300,7 @@ function createUniAppXPlugins(options) {
|
|
|
6221
6300
|
const isIosPlatform = providedIosPlatform ?? utsPlatform.isAppIos;
|
|
6222
6301
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
6223
6302
|
const nativeLocalStyleModuleIds = /* @__PURE__ */ new Set();
|
|
6303
|
+
const webLocalStyle = createUniAppXWebLocalStyleBridge(isWebGeneratorTarget);
|
|
6224
6304
|
let componentLocalStyleEnabled;
|
|
6225
6305
|
const isNativeAppBuildTarget = createUniAppXNativeBuildTargetResolver(getResolvedConfig);
|
|
6226
6306
|
const nativeHmrReloader = createUniAppXNativeHmrReloader({
|
|
@@ -6245,8 +6325,8 @@ function createUniAppXPlugins(options) {
|
|
|
6245
6325
|
componentLocalStyleEnabled = resolveUniAppXStyleIsolationEnabled(root);
|
|
6246
6326
|
return componentLocalStyleEnabled;
|
|
6247
6327
|
}
|
|
6248
|
-
function
|
|
6249
|
-
return isNativeAppBuildTarget(id)
|
|
6328
|
+
function shouldEnablePageLocalStyleForFile(id) {
|
|
6329
|
+
return resolvedUniAppXOptions.componentLocalStyles.enabled && (isNativeAppBuildTarget(id) || require_component_local_style.shouldEnablePageLocalStyle(id));
|
|
6250
6330
|
}
|
|
6251
6331
|
function isHarmonyBuildTarget() {
|
|
6252
6332
|
if (require_generator.resolveUniUtsPlatform().isAppHarmony) return true;
|
|
@@ -6284,19 +6364,20 @@ function createUniAppXPlugins(options) {
|
|
|
6284
6364
|
const parsed = query ?? parseVueRequest(id).query;
|
|
6285
6365
|
if (isCSSRequest(id) || parsed.vue && parsed.type === "style") {
|
|
6286
6366
|
if (isCssModuleExport(code)) return;
|
|
6287
|
-
const
|
|
6288
|
-
const
|
|
6367
|
+
const sourceCode = normalizeRelativeTailwindReferences(code, id);
|
|
6368
|
+
const hasTailwindRoot = require_generator.hasTailwindRootDirectives(sourceCode, { importFallback: true });
|
|
6369
|
+
const hasTailwindApply = require_generator.hasTailwindApplyDirective(sourceCode);
|
|
6289
6370
|
const shouldGenerateCss = hasTailwindRoot || hasTailwindApply;
|
|
6290
6371
|
const isNativeSfcAuthorStyle = isNativeStyle && resolveUniAppXCssTarget(id) === "uvue";
|
|
6291
6372
|
if (!shouldGenerateCss && (!isNativeStyle || isNativeSfcAuthorStyle)) return;
|
|
6292
|
-
harmonyApply.rememberSource(
|
|
6293
|
-
const generatedCss = shouldGenerateCss ? await generateCss?.(id, isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot ? harmonyApply.prepareStyles(
|
|
6373
|
+
harmonyApply.rememberSource(sourceCode, id);
|
|
6374
|
+
const generatedCss = shouldGenerateCss ? await generateCss?.(id, isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot ? harmonyApply.prepareStyles(sourceCode, id) : sourceCode, {
|
|
6294
6375
|
...hookContext,
|
|
6295
6376
|
disableSourceScan: isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot,
|
|
6296
6377
|
sourceCandidates: isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot ? [] : void 0,
|
|
6297
6378
|
transient: isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot
|
|
6298
6379
|
}) : void 0;
|
|
6299
|
-
const styleCode = typeof generatedCss === "string" && generatedCss.trim().length > 0 ? hasTailwindApply && !hasTailwindRoot ? retainUniAppXAuthorApplyCss(generatedCss,
|
|
6380
|
+
const styleCode = typeof generatedCss === "string" && generatedCss.trim().length > 0 ? hasTailwindApply && !hasTailwindRoot ? retainUniAppXAuthorApplyCss(generatedCss, sourceCode) : generatedCss : sourceCode;
|
|
6300
6381
|
const styleHandlerOptions = getStyleHandlerOptions(id, isNativeStyle && hasTailwindRoot ? "tailwind-root" : isNativeStyle ? "author-apply" : void 0);
|
|
6301
6382
|
const postcssResult = await styleHandler(styleCode, styleHandlerOptions);
|
|
6302
6383
|
reportStyleWarnings(postcssResult);
|
|
@@ -6331,15 +6412,49 @@ function createUniAppXPlugins(options) {
|
|
|
6331
6412
|
if (!isEnabled()) return;
|
|
6332
6413
|
await runtimeState.readyPromise;
|
|
6333
6414
|
const { query } = parseVueRequest(id);
|
|
6334
|
-
const
|
|
6415
|
+
const styleCode = query.vue && query.type === "style" ? webLocalStyle.appendToStyle(code, id) : code;
|
|
6416
|
+
const preprocessor = resolvePreprocessorTransform(styleCode, id, query.lang, {
|
|
6335
6417
|
isIosPlatform,
|
|
6336
6418
|
isNativeAppStyleTarget: isNativeAppStyleTarget(),
|
|
6337
6419
|
isWebGeneratorTarget: isWebGeneratorTarget()
|
|
6338
6420
|
});
|
|
6339
|
-
if (preprocessor) return preprocessor.result
|
|
6340
|
-
|
|
6421
|
+
if (preprocessor) return preprocessor.result ?? (styleCode !== code ? {
|
|
6422
|
+
code: styleCode,
|
|
6423
|
+
map: null
|
|
6424
|
+
} : void 0);
|
|
6425
|
+
return transformStyle(styleCode, id, query, this);
|
|
6341
6426
|
}
|
|
6342
6427
|
}];
|
|
6428
|
+
async function transformSfc(code, id, context) {
|
|
6429
|
+
if (isNativeAppBuildTarget(id)) {
|
|
6430
|
+
nativeLocalStyleModuleIds.add(id);
|
|
6431
|
+
nativeLocalStyleModuleIds.add((0, _weapp_tailwindcss_shared.cleanUrl)(id));
|
|
6432
|
+
}
|
|
6433
|
+
harmonyApply.rememberSource(code, id, true);
|
|
6434
|
+
const resolvedConfig = getResolvedConfig();
|
|
6435
|
+
const shouldForceRefresh = resolvedConfig?.command === "serve" || resolvedConfig?.command === "build";
|
|
6436
|
+
const currentRuntimeSet = await ensureRuntimeClassSet(shouldForceRefresh);
|
|
6437
|
+
nativeHmrReloader.remember(currentRuntimeSet);
|
|
6438
|
+
const transformUVue = await loadTransformUVue();
|
|
6439
|
+
const enableComponentLocalStyle = shouldEnableComponentLocalStyle();
|
|
6440
|
+
const enablePageLocalStyle = shouldEnablePageLocalStyleForFile(id);
|
|
6441
|
+
const transformOptions = require_object.omitUndefined({
|
|
6442
|
+
...customAttributesEntities.length > 0 ? { customAttributesEntities } : {},
|
|
6443
|
+
...disabledDefaultTemplateHandler ? { disabledDefaultTemplateHandler } : {},
|
|
6444
|
+
...enableComponentLocalStyle ? { enableComponentLocalStyle } : {},
|
|
6445
|
+
...enablePageLocalStyle ? { enablePageLocalStyle } : {},
|
|
6446
|
+
...isWebGeneratorTarget() && customAttributesEntities.length > 0 ? { webCustomAttributeDeep: true } : {},
|
|
6447
|
+
...isWebGeneratorTarget() ? { onWebLocalStyleRules: (rules) => webLocalStyle.remember(id, rules) } : {}
|
|
6448
|
+
});
|
|
6449
|
+
const result = Object.keys(transformOptions).length > 0 ? transformUVue(code, id, jsHandler, currentRuntimeSet, transformOptions) : transformUVue(code, id, jsHandler, currentRuntimeSet);
|
|
6450
|
+
if (!result?.code) return result;
|
|
6451
|
+
harmonyApply.rememberSource(result.code, id);
|
|
6452
|
+
const expandedCode = await harmonyApply.expandStyles(result.code, id, context);
|
|
6453
|
+
return expandedCode === result.code ? result : {
|
|
6454
|
+
code: expandedCode,
|
|
6455
|
+
map: null
|
|
6456
|
+
};
|
|
6457
|
+
}
|
|
6343
6458
|
const nvuePlugin = {
|
|
6344
6459
|
name: "weapp-tailwindcss:uni-app-x:nvue",
|
|
6345
6460
|
enforce: "pre",
|
|
@@ -6352,42 +6467,17 @@ function createUniAppXPlugins(options) {
|
|
|
6352
6467
|
async handler(code, id) {
|
|
6353
6468
|
if (!isEnabled()) return;
|
|
6354
6469
|
if (!UVUE_NVUE_QUERY_RE.test(id)) return;
|
|
6355
|
-
|
|
6356
|
-
nativeLocalStyleModuleIds.add(id);
|
|
6357
|
-
nativeLocalStyleModuleIds.add((0, _weapp_tailwindcss_shared.cleanUrl)(id));
|
|
6358
|
-
}
|
|
6359
|
-
harmonyApply.rememberSource(code, id, true);
|
|
6360
|
-
const resolvedConfig = getResolvedConfig();
|
|
6361
|
-
const isServeCommand = resolvedConfig?.command === "serve";
|
|
6362
|
-
const isWatchBuild = resolvedConfig?.command === "build" && !!resolvedConfig.build?.watch;
|
|
6363
|
-
const isNonWatchBuild = resolvedConfig?.command === "build" && !resolvedConfig.build?.watch;
|
|
6364
|
-
const currentRuntimeSet = isServeCommand || isWatchBuild || isNonWatchBuild ? await ensureRuntimeClassSet(true) : await ensureRuntimeClassSet();
|
|
6365
|
-
nativeHmrReloader.remember(currentRuntimeSet);
|
|
6366
|
-
const transformUVue = await loadTransformUVue();
|
|
6367
|
-
const enableComponentLocalStyle = shouldEnableComponentLocalStyle();
|
|
6368
|
-
const enablePageLocalStyle = shouldEnableNativePageLocalStyle(id);
|
|
6369
|
-
const result = customAttributesEntities.length > 0 || disabledDefaultTemplateHandler || enableComponentLocalStyle || enablePageLocalStyle ? transformUVue(code, id, jsHandler, currentRuntimeSet, require_object.omitUndefined({
|
|
6370
|
-
...customAttributesEntities.length > 0 ? { customAttributesEntities } : {},
|
|
6371
|
-
...disabledDefaultTemplateHandler ? { disabledDefaultTemplateHandler } : {},
|
|
6372
|
-
...enableComponentLocalStyle ? { enableComponentLocalStyle } : {},
|
|
6373
|
-
...enablePageLocalStyle ? { enablePageLocalStyle } : {}
|
|
6374
|
-
})) : transformUVue(code, id, jsHandler, currentRuntimeSet);
|
|
6375
|
-
if (result?.code) {
|
|
6376
|
-
harmonyApply.rememberSource(result.code, id);
|
|
6377
|
-
const expandedCode = await harmonyApply.expandStyles(result.code, id, this);
|
|
6378
|
-
if (expandedCode !== result.code) return {
|
|
6379
|
-
code: expandedCode,
|
|
6380
|
-
map: null
|
|
6381
|
-
};
|
|
6382
|
-
}
|
|
6383
|
-
return result;
|
|
6470
|
+
return transformSfc(code, id, this);
|
|
6384
6471
|
}
|
|
6385
6472
|
},
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6473
|
+
handleHotUpdate: {
|
|
6474
|
+
order: "post",
|
|
6475
|
+
async handler(ctx) {
|
|
6476
|
+
if (!isEnabled() || getResolvedConfig()?.command !== "serve") return;
|
|
6477
|
+
if (!UVUE_NVUE_RE.test(ctx.file) && !isCSSRequest(ctx.file)) return;
|
|
6478
|
+
if (isWebGeneratorTarget() && UVUE_NVUE_RE.test(ctx.file) && typeof ctx.read === "function") await transformSfc(await ctx.read(), ctx.file, this);
|
|
6479
|
+
return webLocalStyle.handleHotUpdate(ctx) ?? nativeHmrReloader.handleHotUpdate(ctx);
|
|
6480
|
+
}
|
|
6391
6481
|
},
|
|
6392
6482
|
async watchChange(id) {
|
|
6393
6483
|
if (!isEnabled()) return;
|
|
@@ -8154,15 +8244,25 @@ function resolveProcessedCssAssets(cssAssets, records, options, bundleFiles) {
|
|
|
8154
8244
|
const recordCss = typeof record === "string" ? record : record.css;
|
|
8155
8245
|
const outputFile = typeof record === "string" ? resolveProcessedCssOutputFile(file, options, bundleFiles) : record.outputFile ?? resolveProcessedCssOutputFile(file, options, bundleFiles);
|
|
8156
8246
|
let output = assetBySourceFile.get(require_source_candidate_scan_signature.normalizeOutputPathKey(file)) ?? (outputFile ? cssAssets.get(require_source_candidate_scan_signature.normalizeOutputPathKey(outputFile)) : void 0);
|
|
8247
|
+
let useAssetSource = output !== void 0;
|
|
8157
8248
|
if (!output) {
|
|
8158
8249
|
const matchingAssets = [...cssAssets.values()].filter((candidate) => options.context.isCssAssetProcessed(candidate.asset, candidate.file) && resolveViteProcessedCssAssetSource(candidate.file, candidate.original, (sourceFile) => resolveProcessedCssOutputFile(sourceFile, options, bundleFiles)) === recordCss);
|
|
8159
|
-
if (matchingAssets.length === 1)
|
|
8250
|
+
if (matchingAssets.length === 1) {
|
|
8251
|
+
output = matchingAssets[0];
|
|
8252
|
+
useAssetSource = true;
|
|
8253
|
+
}
|
|
8254
|
+
}
|
|
8255
|
+
if (!output && records.length === 1 && htmlOwnedAssets.length === 1) {
|
|
8256
|
+
output = htmlOwnedAssets[0];
|
|
8257
|
+
useAssetSource = require_generator.hasTailwindGeneratedCss(output.original) || require_generator.hasTailwindGeneratedCssMarkers(output.original);
|
|
8160
8258
|
}
|
|
8161
|
-
if (!output && records.length === 1 && htmlOwnedAssets.length === 1) output = htmlOwnedAssets[0];
|
|
8162
8259
|
if (!output) return;
|
|
8163
|
-
const
|
|
8164
|
-
if (
|
|
8165
|
-
processedAssets.set(output,
|
|
8260
|
+
const existing = processedAssets.get(output);
|
|
8261
|
+
if (existing !== void 0 && existing.css !== recordCss) return;
|
|
8262
|
+
processedAssets.set(output, {
|
|
8263
|
+
css: recordCss,
|
|
8264
|
+
useAssetSource
|
|
8265
|
+
});
|
|
8166
8266
|
}
|
|
8167
8267
|
return processedAssets;
|
|
8168
8268
|
}
|
|
@@ -8192,9 +8292,10 @@ function tryFinalizeGenericWebCss(options) {
|
|
|
8192
8292
|
options.recordTiming("processedCss.collect", collectStartedAt);
|
|
8193
8293
|
if (!processedAssets) return false;
|
|
8194
8294
|
const writeStartedAt = performance.now();
|
|
8195
|
-
for (const [{ asset, file, original },
|
|
8295
|
+
for (const [{ asset, file, original }, processed] of processedAssets) {
|
|
8196
8296
|
const finalizeStartedAt = performance.now();
|
|
8197
|
-
const
|
|
8297
|
+
const finalCssSource = processed.useAssetSource ? original : processed.css;
|
|
8298
|
+
const generated = finalizeWebCss(require_v4_generation_core.stripBundlerGeneratedCssMarkers(finalCssSource), {
|
|
8198
8299
|
...options.createCssPipelineContext(file),
|
|
8199
8300
|
file
|
|
8200
8301
|
}, context.cssPipelineStrategy);
|
|
@@ -8308,6 +8409,13 @@ function createViteCssFinalizerOutputPlugin(context) {
|
|
|
8308
8409
|
}),
|
|
8309
8410
|
targetByFile: frameworkRootImportShellTargetByFile ?? /* @__PURE__ */ new Map()
|
|
8310
8411
|
});
|
|
8412
|
+
if (!isWebGeneratorTarget) linkFrameworkRootStyleToRuntimeEntry(bundle, {
|
|
8413
|
+
debug,
|
|
8414
|
+
matchesCss: opts.cssMatcher,
|
|
8415
|
+
onUpdate: trackFinalCssAssetUpdate,
|
|
8416
|
+
recordCssAssetResult,
|
|
8417
|
+
targetByFile: frameworkRootImportShellTargetByFile ?? /* @__PURE__ */ new Map()
|
|
8418
|
+
});
|
|
8311
8419
|
const sourceTraceTokenSources = getSourceCandidateSourcesForEntries ? require_v4_generation_core.createCssTokenSourceMap(getSourceCandidateSourcesForEntries(void 0), opts) : void 0;
|
|
8312
8420
|
const annotateCss = (css) => require_v4_generation_core.annotateCssSourceTrace(css, {
|
|
8313
8421
|
opts,
|
|
@@ -9338,6 +9446,22 @@ function createViteHmrCandidateState(options) {
|
|
|
9338
9446
|
};
|
|
9339
9447
|
}
|
|
9340
9448
|
//#endregion
|
|
9449
|
+
//#region src/bundlers/vite/shared/framework-plugin-order.ts
|
|
9450
|
+
function orderFrameworkSourceCandidatePlugins(extraPlugins, rewritePlugins, sourceCandidatesPlugin, beforeExtraPlugin) {
|
|
9451
|
+
const anchor = beforeExtraPlugin ? extraPlugins.findIndex(beforeExtraPlugin) : -1;
|
|
9452
|
+
if (anchor < 0) return [
|
|
9453
|
+
...extraPlugins,
|
|
9454
|
+
...rewritePlugins,
|
|
9455
|
+
sourceCandidatesPlugin
|
|
9456
|
+
];
|
|
9457
|
+
return [
|
|
9458
|
+
...extraPlugins.slice(0, anchor),
|
|
9459
|
+
...rewritePlugins,
|
|
9460
|
+
sourceCandidatesPlugin,
|
|
9461
|
+
...extraPlugins.slice(anchor)
|
|
9462
|
+
];
|
|
9463
|
+
}
|
|
9464
|
+
//#endregion
|
|
9341
9465
|
//#region src/bundlers/vite/official-tailwind-plugins.ts
|
|
9342
9466
|
function isTailwindVitePlugin(plugin) {
|
|
9343
9467
|
if (!plugin || typeof plugin !== "object" || !("name" in plugin)) return false;
|
|
@@ -9678,7 +9802,7 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9678
9802
|
const hotRoot = ctx.server.config?.root ?? node_process.default.cwd();
|
|
9679
9803
|
const sourceModules = isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) ? await resolveHotSourceModules(ctx) : ctx.modules;
|
|
9680
9804
|
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file)) {
|
|
9681
|
-
sendSupplementalSourceHotUpdates(ctx, sourceModules);
|
|
9805
|
+
if (!/\.(?:uvue|nvue)$/i.test((0, _weapp_tailwindcss_shared.cleanUrl)(ctx.file))) sendSupplementalSourceHotUpdates(ctx, sourceModules);
|
|
9682
9806
|
if (sourceModules.some((mod) => {
|
|
9683
9807
|
const id = mod.id ?? mod.url;
|
|
9684
9808
|
return typeof id === "string" && /[?&]macro=true(?:&|$)/.test(id) === false && typeof mod.url === "string" && mod.url.startsWith("/pages/") && /\.vue(?:$|[?#])/i.test(id);
|
|
@@ -9739,6 +9863,12 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9739
9863
|
const sourceCandidateScanCache = new lru_cache.LRUCache({ max: SOURCE_CANDIDATE_SCAN_CACHE_MAX });
|
|
9740
9864
|
let sourceScanEntries;
|
|
9741
9865
|
let sourceScanMatcher;
|
|
9866
|
+
let sourceScanBoundaryMatcher;
|
|
9867
|
+
let sourceScanRoots = [];
|
|
9868
|
+
let sourceScanOutDir;
|
|
9869
|
+
let sourceScanEligibleFiles = /* @__PURE__ */ new Set();
|
|
9870
|
+
let sourceScanEligibleFilesRefresh;
|
|
9871
|
+
const sourceScanIneligibleFiles = /* @__PURE__ */ new Set();
|
|
9742
9872
|
let sourceScanDependencies = /* @__PURE__ */ new Set();
|
|
9743
9873
|
let sourceScanExplicit = false;
|
|
9744
9874
|
let sourceCandidateScanSignature;
|
|
@@ -9750,6 +9880,7 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9750
9880
|
const isDependency = (file) => sourceScanDependencies.has(normalizeDependency(file));
|
|
9751
9881
|
const invalidate = () => {
|
|
9752
9882
|
sourceCandidateScanInvalidated = true;
|
|
9883
|
+
sourceScanIneligibleFiles.clear();
|
|
9753
9884
|
};
|
|
9754
9885
|
const hasState = () => sourceCandidateScanSignature !== void 0;
|
|
9755
9886
|
const collectRoots = (root, entries) => {
|
|
@@ -9780,9 +9911,32 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9780
9911
|
};
|
|
9781
9912
|
const cacheCurrent = () => {
|
|
9782
9913
|
if (!sourceCandidateScanSignature) return;
|
|
9783
|
-
const
|
|
9784
|
-
|
|
9785
|
-
|
|
9914
|
+
const entry = {
|
|
9915
|
+
eligibleFiles: [...sourceScanEligibleFiles],
|
|
9916
|
+
snapshot: options.sourceCandidateCollector.snapshot()
|
|
9917
|
+
};
|
|
9918
|
+
sourceCandidateScanCache.set(sourceCandidateScanSignature, entry);
|
|
9919
|
+
sourceCandidateScanSnapshotCache.set(sourceCandidateScanSignature, entry);
|
|
9920
|
+
};
|
|
9921
|
+
const updateSourceScanMatchers = (eligibleFiles) => {
|
|
9922
|
+
sourceScanEligibleFiles = new Set(eligibleFiles);
|
|
9923
|
+
const matcherRoots = sourceScanRoots.map((scanRoot) => ({
|
|
9924
|
+
...scanRoot,
|
|
9925
|
+
outDir: sourceScanOutDir
|
|
9926
|
+
}));
|
|
9927
|
+
sourceScanBoundaryMatcher = require_v4_generation_core.createSourceCandidateEligibilityMatcher(matcherRoots);
|
|
9928
|
+
sourceScanMatcher = require_v4_generation_core.createSourceCandidateEligibilityMatcher(matcherRoots, sourceScanEligibleFiles);
|
|
9929
|
+
};
|
|
9930
|
+
const refreshSourceScanEligibleFiles = async () => {
|
|
9931
|
+
sourceScanEligibleFilesRefresh ?? (sourceScanEligibleFilesRefresh = Promise.all(sourceScanRoots.map((scanRoot) => options.sourceCandidateCollector.resolveScanFiles({
|
|
9932
|
+
entries: scanRoot.entries,
|
|
9933
|
+
explicit: scanRoot.explicit,
|
|
9934
|
+
root: scanRoot.root,
|
|
9935
|
+
outDir: sourceScanOutDir
|
|
9936
|
+
}))).then((files) => updateSourceScanMatchers(files.flat())).finally(() => {
|
|
9937
|
+
sourceScanEligibleFilesRefresh = void 0;
|
|
9938
|
+
}));
|
|
9939
|
+
await sourceScanEligibleFilesRefresh;
|
|
9786
9940
|
};
|
|
9787
9941
|
const shouldDiscoverAutoCssSources = (autoCssSourcesDiscovered) => {
|
|
9788
9942
|
if (!autoCssSourcesDiscovered || !options.isWatchLikeBuild()) return true;
|
|
@@ -9805,10 +9959,8 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9805
9959
|
sourceScanExplicit = sourceScan?.explicit ?? false;
|
|
9806
9960
|
sourceScanDependencies = new Set((sourceScan?.dependencies ?? []).map(normalizeDependency));
|
|
9807
9961
|
const roots = collectRoots(root, sourceScanEntries);
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
outDir
|
|
9811
|
-
})));
|
|
9962
|
+
sourceScanRoots = roots;
|
|
9963
|
+
sourceScanOutDir = outDir;
|
|
9812
9964
|
const nextScanSignature = require_source_candidate_scan_signature.createSourceCandidateScanSignature({
|
|
9813
9965
|
inlineCandidates: sourceScan?.inlineCandidates,
|
|
9814
9966
|
outDir,
|
|
@@ -9817,14 +9969,16 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9817
9969
|
});
|
|
9818
9970
|
if (hasState() && sourceCandidateScanSignature === nextScanSignature) {
|
|
9819
9971
|
options.sourceCandidateCollector.syncInline(sourceScan?.inlineCandidates);
|
|
9820
|
-
|
|
9972
|
+
cacheCurrent();
|
|
9821
9973
|
options.debug("reuse vite source candidate scan for watch rebuild");
|
|
9822
9974
|
sourceCandidateScanInvalidated = false;
|
|
9823
9975
|
return;
|
|
9824
9976
|
}
|
|
9825
9977
|
const cachedScan = options.isWatchLikeBuild() ? sourceCandidateScanCache.get(nextScanSignature) ?? sourceCandidateScanSnapshotCache.get(nextScanSignature) : void 0;
|
|
9826
9978
|
if (cachedScan) {
|
|
9827
|
-
options.sourceCandidateCollector.restore(cachedScan);
|
|
9979
|
+
options.sourceCandidateCollector.restore(cachedScan.snapshot);
|
|
9980
|
+
sourceScanIneligibleFiles.clear();
|
|
9981
|
+
updateSourceScanMatchers(cachedScan.eligibleFiles);
|
|
9828
9982
|
sourceCandidateScanSignature = nextScanSignature;
|
|
9829
9983
|
options.debug("reuse cached vite source candidate scan for watch rebuild");
|
|
9830
9984
|
sourceCandidateScanInvalidated = false;
|
|
@@ -9833,19 +9987,19 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9833
9987
|
if (options.isWatchLikeBuild()) options.sourceCandidateCollector.resetScan();
|
|
9834
9988
|
else options.sourceCandidateCollector.clearScan();
|
|
9835
9989
|
options.sourceCandidateCollector.syncInline(sourceScan?.inlineCandidates);
|
|
9990
|
+
const eligibleFiles = /* @__PURE__ */ new Set();
|
|
9991
|
+
sourceScanIneligibleFiles.clear();
|
|
9836
9992
|
await Promise.all(roots.map((scanRoot) => options.sourceCandidateCollector.scanRoot({
|
|
9837
9993
|
entries: scanRoot.entries,
|
|
9838
9994
|
explicit: scanRoot.explicit,
|
|
9839
9995
|
root: scanRoot.root,
|
|
9840
|
-
outDir
|
|
9996
|
+
outDir,
|
|
9997
|
+
onFilesResolved: (files) => files.forEach((file) => eligibleFiles.add(file))
|
|
9841
9998
|
})));
|
|
9999
|
+
updateSourceScanMatchers(eligibleFiles);
|
|
9842
10000
|
sourceCandidateScanSignature = nextScanSignature;
|
|
9843
10001
|
sourceCandidateScanInvalidated = false;
|
|
9844
|
-
if (options.isWatchLikeBuild())
|
|
9845
|
-
const snapshot = options.sourceCandidateCollector.snapshot();
|
|
9846
|
-
sourceCandidateScanCache.set(nextScanSignature, snapshot);
|
|
9847
|
-
sourceCandidateScanSnapshotCache.set(nextScanSignature, snapshot);
|
|
9848
|
-
}
|
|
10002
|
+
if (options.isWatchLikeBuild()) cacheCurrent();
|
|
9849
10003
|
};
|
|
9850
10004
|
const waitForPendingSyncs = async () => {
|
|
9851
10005
|
while (pendingSourceCandidateSyncs.size > 0) await Promise.all(pendingSourceCandidateSyncs);
|
|
@@ -9870,11 +10024,16 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9870
10024
|
previous.runtimeAffecting || (previous.runtimeAffecting = change.runtimeAffecting);
|
|
9871
10025
|
return previous;
|
|
9872
10026
|
};
|
|
9873
|
-
const syncChangedFile = (id, sourceOverride) => {
|
|
9874
|
-
if (!options.shouldOwnTailwindGeneration || !options.isCandidateRequest(id)) return
|
|
10027
|
+
const syncChangedFile = async (id, sourceOverride) => {
|
|
10028
|
+
if (!options.shouldOwnTailwindGeneration || !options.isCandidateRequest(id)) return;
|
|
9875
10029
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
9876
10030
|
const runtimeAffectingByDependency = isDependency(file);
|
|
9877
10031
|
if (runtimeAffectingByDependency) invalidate();
|
|
10032
|
+
const resolvedFile = require_generator.resolveSourceScanPath(file);
|
|
10033
|
+
if (sourceScanMatcher && !sourceScanMatcher(file) && sourceScanBoundaryMatcher?.(file) && !sourceScanIneligibleFiles.has(resolvedFile)) {
|
|
10034
|
+
await refreshSourceScanEligibleFiles();
|
|
10035
|
+
if (!sourceScanMatcher(file)) sourceScanIneligibleFiles.add(resolvedFile);
|
|
10036
|
+
}
|
|
9878
10037
|
if (sourceScanMatcher && !sourceScanMatcher(file)) {
|
|
9879
10038
|
const change = options.sourceCandidateCollector.remove(file);
|
|
9880
10039
|
cacheCurrent();
|
|
@@ -9883,7 +10042,10 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9883
10042
|
}) : Promise.resolve()).then(() => options.cssMemory.refreshRememberedCssSourceByCurrentFile(file)).then(() => rememberHotUpdateChange(options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: true }))));
|
|
9884
10043
|
}
|
|
9885
10044
|
const existingTask = pendingSourceCandidateSyncByFile.get(file);
|
|
9886
|
-
if (existingTask)
|
|
10045
|
+
if (existingTask) {
|
|
10046
|
+
await existingTask;
|
|
10047
|
+
return syncChangedFile(id, sourceOverride);
|
|
10048
|
+
}
|
|
9887
10049
|
const previousSource = options.sourceCandidateCollector.source(file);
|
|
9888
10050
|
const task = (sourceOverride === void 0 ? options.sourceCandidateCollector.syncCurrentFile(id) : options.sourceCandidateCollector.syncCurrentSource(id, sourceOverride)).catch((error) => {
|
|
9889
10051
|
options.debug("source candidate watch sync failed: %s %O", id, error);
|
|
@@ -9976,9 +10138,6 @@ function collectConfiguredCssEntries(options) {
|
|
|
9976
10138
|
].filter((item) => typeof item === "string" && item.length > 0);
|
|
9977
10139
|
return entries.length > 0 ? [...new Set(entries)] : void 0;
|
|
9978
10140
|
}
|
|
9979
|
-
function normalizeViteStylePlatform(value, appType) {
|
|
9980
|
-
return require_context.normalizeFrameworkStylePlatform(value, appType);
|
|
9981
|
-
}
|
|
9982
10141
|
function inferPlatformFromOutDir(outDir) {
|
|
9983
10142
|
const segment = outDir ? node_path.default.basename(node_path.default.normalize(outDir)) : void 0;
|
|
9984
10143
|
if (!segment) return;
|
|
@@ -10027,10 +10186,10 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
10027
10186
|
const shouldRewriteCssImports = opts.rewriteCssImports === true;
|
|
10028
10187
|
let resolvedConfig;
|
|
10029
10188
|
const resolveViteStylePlatform = () => {
|
|
10030
|
-
const explicit =
|
|
10189
|
+
const explicit = require_context.normalizeFrameworkStylePlatform(opts.cssOptions?.platform ?? opts.platform, opts.appType);
|
|
10031
10190
|
if (explicit) return explicit;
|
|
10032
10191
|
for (const key of ENV_PLATFORM_KEYS) {
|
|
10033
|
-
const envPlatform =
|
|
10192
|
+
const envPlatform = require_context.normalizeFrameworkStylePlatform(node_process.default.env[key], opts.appType);
|
|
10034
10193
|
if (envPlatform) return envPlatform;
|
|
10035
10194
|
}
|
|
10036
10195
|
return inferPlatformFromOutDir(resolvedConfig?.build?.outDir);
|
|
@@ -10682,9 +10841,7 @@ ${tracedCss}`;
|
|
|
10682
10841
|
syncCssEntriesFromAnchor
|
|
10683
10842
|
});
|
|
10684
10843
|
const plugins = [
|
|
10685
|
-
...extraPlugins,
|
|
10686
|
-
...rewritePlugins,
|
|
10687
|
-
sourceCandidatesPlugin,
|
|
10844
|
+
...orderFrameworkSourceCandidatePlugins(extraPlugins, rewritePlugins, sourceCandidatesPlugin, frameworkBranch.sourceCandidatesBeforeExtraPlugin),
|
|
10688
10845
|
...createViteCssGenerationPlugins({
|
|
10689
10846
|
generateCss: generateTailwindCssForVitePipeline,
|
|
10690
10847
|
getCommand: () => resolvedConfig?.command,
|
|
@@ -11019,6 +11176,7 @@ function createUniAppXVitePlugins(options = {}) {
|
|
|
11019
11176
|
getExtraPluginPlatform: () => ({ isIosPlatform: require_generator.resolveUniUtsPlatform().isAppIos }),
|
|
11020
11177
|
styleInjectorDelegate: require_source_candidate_scan_signature.viteStyleInjectorDelegates.uniApp,
|
|
11021
11178
|
isRuntimeClassSetFeatureEnabled: () => true,
|
|
11179
|
+
sourceCandidatesBeforeExtraPlugin: (plugin) => plugin.name === "weapp-tailwindcss:uni-app-x:nvue",
|
|
11022
11180
|
createExtraPlugins: (context) => createUniAppXPlugins({
|
|
11023
11181
|
appType: "uni-app-x",
|
|
11024
11182
|
customAttributesEntities: context.customAttributesEntities,
|
package/dist/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vite = require("./vite-
|
|
2
|
+
const require_vite = require("./vite-jftHIupF.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
1
|
+
import { t as WeappTailwindcss } from "./vite-DBgbFsei.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
|
@@ -5,10 +5,10 @@ Object.defineProperties(exports, {
|
|
|
5
5
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
6
6
|
const require_generator = require("./generator-BXrWA7Sj.cjs");
|
|
7
7
|
const require_options = require("./options-DbYws6lr.cjs");
|
|
8
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
8
|
+
const require_v4_generation_core = require("./v4-generation-core-BEYGV4eB.cjs");
|
|
9
9
|
const require_style_options = require("./style-options-Cta1OP3i.cjs");
|
|
10
10
|
const require_css_imports = require("./css-imports-BFMU7Hpd.cjs");
|
|
11
|
-
const require_pipeline_helpers = require("./pipeline-helpers-
|
|
11
|
+
const require_pipeline_helpers = require("./pipeline-helpers-DA5-EzbO.cjs");
|
|
12
12
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
13
13
|
const require_watch_dependencies = require("./watch-dependencies-DLZDrWdH.cjs");
|
|
14
14
|
let node_path = require("node:path");
|
|
@@ -2,11 +2,11 @@ import { $ as hasTailwindSourceDirectives, B as stripMiniProgramCssSpecificityPl
|
|
|
2
2
|
import { n as _defineProperty } from "./object-B-8IHefx.js";
|
|
3
3
|
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature } from "./tailwindcss-C2K-vjJv.js";
|
|
4
4
|
import { r as getGroupedEntries } from "./utils-MVwpU07P.js";
|
|
5
|
-
import { $ as getCompilationScopeDependencyRevision, A as annotateCssSourceTrace, C as stripRequestQuery, D as stripBundlerGeneratedCssMarkers, F as createRuntimeClassSetManager, H as buildRuntimeCompilationSnapshot, I as collectStrictEscapedRuntimeCandidates, J as createRuntimeAffectingSourceSignature, K as resetRuntimeCompilationBuildState, L as createEscapeFragments, M as createCssTokenSourceMap, N as isCssSourceTraceEnabled, O as finalizeMiniProgramCssStructure, P as processCachedTask, Q as AssetEmissionPlan, R as isPureLocalCssImportWrapper, S as isSourceStyleRequest, T as hasBundlerGeneratedCssMarker, U as createRuntimeCompilationAffectingSignature, V as finalizeCompilerShadowRun, W as createRuntimeCompilationBuildState, X as beginCompilerShadowRun, Y as disposeCompilerOwner, _ as captureResolvedFrameworkPostcssOptions, at as isSourceCandidateRequest, c as collectRawSourceClassSelectors, ct as resolveSourceCandidateScanFiles, h as removeGeneratedSelectorCompatCss, it as createSourceCandidateStore, j as createCssSourceTraceCacheSignature, l as pushConcurrentTaskFactories, m as scoreTailwindV4CssSourceFileMatch, n as emitHmrTiming, nt as createCompilationDependencyChanges, q as updateRuntimeCompilationBuildState, r as generateTailwindV4Css, tt as recordCompilationDependencyChanges, u as resolveTaskConcurrency, v as collectFrameworkPostcssOptionsFromLoaderEntries, x as hasMiniProgramTailwindV4PreflightReset, y as createCssSourceOrderAppend } from "./hmr-timing-
|
|
5
|
+
import { $ as getCompilationScopeDependencyRevision, A as annotateCssSourceTrace, C as stripRequestQuery, D as stripBundlerGeneratedCssMarkers, F as createRuntimeClassSetManager, H as buildRuntimeCompilationSnapshot, I as collectStrictEscapedRuntimeCandidates, J as createRuntimeAffectingSourceSignature, K as resetRuntimeCompilationBuildState, L as createEscapeFragments, M as createCssTokenSourceMap, N as isCssSourceTraceEnabled, O as finalizeMiniProgramCssStructure, P as processCachedTask, Q as AssetEmissionPlan, R as isPureLocalCssImportWrapper, S as isSourceStyleRequest, T as hasBundlerGeneratedCssMarker, U as createRuntimeCompilationAffectingSignature, V as finalizeCompilerShadowRun, W as createRuntimeCompilationBuildState, X as beginCompilerShadowRun, Y as disposeCompilerOwner, _ as captureResolvedFrameworkPostcssOptions, at as isSourceCandidateRequest, c as collectRawSourceClassSelectors, ct as resolveSourceCandidateScanFiles, h as removeGeneratedSelectorCompatCss, it as createSourceCandidateStore, j as createCssSourceTraceCacheSignature, l as pushConcurrentTaskFactories, m as scoreTailwindV4CssSourceFileMatch, n as emitHmrTiming, nt as createCompilationDependencyChanges, q as updateRuntimeCompilationBuildState, r as generateTailwindV4Css, tt as recordCompilationDependencyChanges, u as resolveTaskConcurrency, v as collectFrameworkPostcssOptionsFromLoaderEntries, x as hasMiniProgramTailwindV4PreflightReset, y as createCssSourceOrderAppend } from "./hmr-timing-Dq1_msos.js";
|
|
6
6
|
import { _ as md5Hash, m as createDebug } from "./wxml-B7OAVpXJ.js";
|
|
7
7
|
import { d as refreshTailwindRuntimeState, i as pluginName, l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, r as resolveStyleOptionsFromContext, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-CKQKq4Mv.js";
|
|
8
8
|
import { getDefaultCssPreflight } from "./defaults.js";
|
|
9
|
-
import { S as resolveWebpackFrameworkProfile, a as createCandidateSignature, b as webpackStyleInjectorDelegates, d as classifyRuntimeEntry, f as resolvePackageDir, g as toAbsoluteOutputPath, h as resolveOutputSpecifier, p as resolvePluginDisabledState, r as createScopedGeneratorRuntime, t as createSourceCandidateScanSignature, v as createBuiltinWebpackStyleInjectorPlugin } from "./source-candidate-scan-signature-
|
|
9
|
+
import { S as resolveWebpackFrameworkProfile, a as createCandidateSignature, b as webpackStyleInjectorDelegates, d as classifyRuntimeEntry, f as resolvePackageDir, g as toAbsoluteOutputPath, h as resolveOutputSpecifier, p as resolvePluginDisabledState, r as createScopedGeneratorRuntime, t as createSourceCandidateScanSignature, v as createBuiltinWebpackStyleInjectorPlugin } from "./source-candidate-scan-signature-DSsjYtlq.js";
|
|
10
10
|
import Module, { createRequire } from "node:module";
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -2497,7 +2497,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2497
2497
|
});
|
|
2498
2498
|
}
|
|
2499
2499
|
//#endregion
|
|
2500
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.20.0_tsx@4.
|
|
2500
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.20.0_tsx@4.23_5ae7d2d7d391b2b2b2eb29443b136e15/node_modules/tsdown/esm-shims.js
|
|
2501
2501
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
2502
2502
|
const getDirname = () => path.dirname(getFilename());
|
|
2503
2503
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
@@ -3,14 +3,14 @@ const require_generator = require("./generator-BXrWA7Sj.cjs");
|
|
|
3
3
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
4
4
|
const require_options = require("./options-DbYws6lr.cjs");
|
|
5
5
|
const require_utils = require("./utils-CuKLf1Zv.cjs");
|
|
6
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
6
|
+
const require_v4_generation_core = require("./v4-generation-core-BEYGV4eB.cjs");
|
|
7
7
|
const require_wxml = require("./wxml-CQmBCjOR.cjs");
|
|
8
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
8
|
+
const require_hmr_timing = require("./hmr-timing-pF6k35pP.cjs");
|
|
9
9
|
const require_context = require("./context-vWlNv-Cf.cjs");
|
|
10
10
|
const require_tailwindcss = require("./tailwindcss-D1M2xj5O.cjs");
|
|
11
11
|
const require_style_options = require("./style-options-Cta1OP3i.cjs");
|
|
12
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
13
|
-
const require_pipeline_helpers = require("./pipeline-helpers-
|
|
12
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-DGQufJk3.cjs");
|
|
13
|
+
const require_pipeline_helpers = require("./pipeline-helpers-DA5-EzbO.cjs");
|
|
14
14
|
const require_css_loader_runtime = require("./css-loader-runtime-CSv0lKqV.cjs");
|
|
15
15
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
16
16
|
let node_fs = require("node:fs");
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_webpack = require("./webpack-
|
|
2
|
+
const require_webpack = require("./webpack-DhwW2cva.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_webpack.WeappTailwindcss;
|
|
5
5
|
exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
|
package/dist/webpack.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-BSIWFzAA.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|