weapp-tailwindcss 5.2.14 → 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.
Files changed (59) hide show
  1. package/README.md +55 -8
  2. package/README.zh-CN.md +64 -0
  3. package/dist/bundlers/rspack/rule-match.d.ts +13 -0
  4. package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +7 -0
  5. package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +1 -0
  6. package/dist/bundlers/vite/shared/framework-plugin-order.d.ts +2 -0
  7. package/dist/{transform-BiHG42Rp.cjs → component-local-style-BirkN5f8.cjs} +33 -168
  8. package/dist/{transform-52FLRu-0.js → component-local-style-CFL4ClhS.js} +22 -174
  9. package/dist/generator/index.d.ts +2 -2
  10. package/dist/generator.cjs +7 -0
  11. package/dist/generator.js +2 -2
  12. package/dist/{gulp-DzIR7eO3.cjs → gulp-B0qcNiuP.cjs} +2 -2
  13. package/dist/{gulp-DG6cWPF4.js → gulp-D1vDx4H1.js} +1 -1
  14. package/dist/gulp.cjs +1 -1
  15. package/dist/gulp.js +1 -1
  16. package/dist/{hmr-timing-CoyM6Dg2.js → hmr-timing-Dq1_msos.js} +5 -7
  17. package/dist/{hmr-timing-BIPr9t9m.cjs → hmr-timing-pF6k35pP.cjs} +1 -1
  18. package/dist/index.cjs +3 -3
  19. package/dist/index.js +3 -3
  20. package/dist/{pipeline-helpers-Bp343-ik.cjs → pipeline-helpers-DA5-EzbO.cjs} +1 -1
  21. package/dist/rspack.cjs +124 -7
  22. package/dist/rspack.js +124 -7
  23. package/dist/{source-candidate-scan-signature-J9EW91KX.cjs → source-candidate-scan-signature-DGQufJk3.cjs} +1 -1
  24. package/dist/{source-candidate-scan-signature-BLXoEZN5.js → source-candidate-scan-signature-DSsjYtlq.js} +1 -1
  25. package/dist/tailwindcss/candidates.d.ts +2 -2
  26. package/dist/transform-BYhgJszj.cjs +200 -0
  27. package/dist/transform-Ck31voUU.js +201 -0
  28. package/dist/uni-app-x/component-local-style.d.ts +3 -1
  29. package/dist/uni-app-x/transform.d.ts +2 -0
  30. package/dist/uni-app-x/vite/style-request.d.ts +1 -0
  31. package/dist/uni-app-x/vite/web-local-style.d.ts +6 -0
  32. package/dist/{v4-generation-core-CCnEsAgV.cjs → v4-generation-core-BEYGV4eB.cjs} +5 -7
  33. package/dist/{vite-DNTQV3gN.js → vite-DBgbFsei.js} +184 -64
  34. package/dist/{vite-RJpkDte7.cjs → vite-jftHIupF.cjs} +184 -64
  35. package/dist/vite.cjs +1 -1
  36. package/dist/vite.js +1 -1
  37. package/dist/weapp-tw-css-import-rewrite-loader.cjs +2 -2
  38. package/dist/{webpack-DYoIysDo.js → webpack-BSIWFzAA.js} +3 -3
  39. package/dist/{webpack-BY5y7f0X.cjs → webpack-DhwW2cva.cjs} +4 -4
  40. package/dist/webpack.cjs +1 -1
  41. package/dist/webpack.js +1 -1
  42. package/package.json +9 -14
  43. package/README.en.md +0 -17
  44. package/bin/weapp-tailwindcss.cjs +0 -8
  45. package/dist/cli/context.d.ts +0 -3
  46. package/dist/cli/doctor/constants.d.ts +0 -7
  47. package/dist/cli/doctor/types.d.ts +0 -31
  48. package/dist/cli/doctor.d.ts +0 -4
  49. package/dist/cli/helpers/options/format.d.ts +0 -2
  50. package/dist/cli/helpers/options/parse.d.ts +0 -3
  51. package/dist/cli/helpers/options/resolve.d.ts +0 -1
  52. package/dist/cli/helpers/options.d.ts +0 -3
  53. package/dist/cli/helpers.d.ts +0 -4
  54. package/dist/cli/mount-options.d.ts +0 -4
  55. package/dist/cli/types.d.ts +0 -15
  56. package/dist/cli/vscode-entry.d.ts +0 -14
  57. package/dist/cli.cjs +0 -37065
  58. package/dist/cli.d.ts +0 -1
  59. 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-CCnEsAgV.cjs");
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-BIPr9t9m.cjs");
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-J9EW91KX.cjs");
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-BiHG42Rp.cjs")).then((mod) => mod.transformUVue));
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 shouldEnableNativePageLocalStyle(id) {
6249
- return isNativeAppBuildTarget(id) && resolvedUniAppXOptions.componentLocalStyles.enabled;
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 hasTailwindRoot = require_generator.hasTailwindRootDirectives(code, { importFallback: true });
6288
- const hasTailwindApply = require_generator.hasTailwindApplyDirective(code);
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(code, id);
6293
- const generatedCss = shouldGenerateCss ? await generateCss?.(id, isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot ? harmonyApply.prepareStyles(code, id) : code, {
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, code) : generatedCss : code;
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 preprocessor = resolvePreprocessorTransform(code, id, query.lang, {
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
- return transformStyle(code, id, query, this);
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
- if (isNativeAppBuildTarget(id)) {
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
- async handleHotUpdate(ctx) {
6387
- if (!isEnabled()) return;
6388
- if (getResolvedConfig()?.command !== "serve") return;
6389
- if (!UVUE_NVUE_RE.test(ctx.file) && !isCSSRequest(ctx.file)) return;
6390
- return nativeHmrReloader.handleHotUpdate(ctx);
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) output = matchingAssets[0];
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 existingCss = processedAssets.get(output);
8164
- if (existingCss !== void 0 && existingCss !== recordCss) return;
8165
- processedAssets.set(output, recordCss);
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 }, processedCss] of processedAssets) {
8295
+ for (const [{ asset, file, original }, processed] of processedAssets) {
8196
8296
  const finalizeStartedAt = performance.now();
8197
- const generated = finalizeWebCss(require_v4_generation_core.stripBundlerGeneratedCssMarkers(processedCss), {
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);
@@ -10014,9 +10138,6 @@ function collectConfiguredCssEntries(options) {
10014
10138
  ].filter((item) => typeof item === "string" && item.length > 0);
10015
10139
  return entries.length > 0 ? [...new Set(entries)] : void 0;
10016
10140
  }
10017
- function normalizeViteStylePlatform(value, appType) {
10018
- return require_context.normalizeFrameworkStylePlatform(value, appType);
10019
- }
10020
10141
  function inferPlatformFromOutDir(outDir) {
10021
10142
  const segment = outDir ? node_path.default.basename(node_path.default.normalize(outDir)) : void 0;
10022
10143
  if (!segment) return;
@@ -10065,10 +10186,10 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
10065
10186
  const shouldRewriteCssImports = opts.rewriteCssImports === true;
10066
10187
  let resolvedConfig;
10067
10188
  const resolveViteStylePlatform = () => {
10068
- const explicit = normalizeViteStylePlatform(opts.cssOptions?.platform ?? opts.platform, opts.appType);
10189
+ const explicit = require_context.normalizeFrameworkStylePlatform(opts.cssOptions?.platform ?? opts.platform, opts.appType);
10069
10190
  if (explicit) return explicit;
10070
10191
  for (const key of ENV_PLATFORM_KEYS) {
10071
- const envPlatform = normalizeViteStylePlatform(node_process.default.env[key], opts.appType);
10192
+ const envPlatform = require_context.normalizeFrameworkStylePlatform(node_process.default.env[key], opts.appType);
10072
10193
  if (envPlatform) return envPlatform;
10073
10194
  }
10074
10195
  return inferPlatformFromOutDir(resolvedConfig?.build?.outDir);
@@ -10720,9 +10841,7 @@ ${tracedCss}`;
10720
10841
  syncCssEntriesFromAnchor
10721
10842
  });
10722
10843
  const plugins = [
10723
- ...extraPlugins,
10724
- ...rewritePlugins,
10725
- sourceCandidatesPlugin,
10844
+ ...orderFrameworkSourceCandidatePlugins(extraPlugins, rewritePlugins, sourceCandidatesPlugin, frameworkBranch.sourceCandidatesBeforeExtraPlugin),
10726
10845
  ...createViteCssGenerationPlugins({
10727
10846
  generateCss: generateTailwindCssForVitePipeline,
10728
10847
  getCommand: () => resolvedConfig?.command,
@@ -11057,6 +11176,7 @@ function createUniAppXVitePlugins(options = {}) {
11057
11176
  getExtraPluginPlatform: () => ({ isIosPlatform: require_generator.resolveUniUtsPlatform().isAppIos }),
11058
11177
  styleInjectorDelegate: require_source_candidate_scan_signature.viteStyleInjectorDelegates.uniApp,
11059
11178
  isRuntimeClassSetFeatureEnabled: () => true,
11179
+ sourceCandidatesBeforeExtraPlugin: (plugin) => plugin.name === "weapp-tailwindcss:uni-app-x:nvue",
11060
11180
  createExtraPlugins: (context) => createUniAppXPlugins({
11061
11181
  appType: "uni-app-x",
11062
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-RJpkDte7.cjs");
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-DNTQV3gN.js";
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-CCnEsAgV.cjs");
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-Bp343-ik.cjs");
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-CoyM6Dg2.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-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-BLXoEZN5.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-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.23_72e8e0e483f4416a066633b00158b95b/node_modules/tsdown/esm-shims.js
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-CCnEsAgV.cjs");
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-BIPr9t9m.cjs");
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-J9EW91KX.cjs");
13
- const require_pipeline_helpers = require("./pipeline-helpers-Bp343-ik.cjs");
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-BY5y7f0X.cjs");
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-DYoIysDo.js";
1
+ import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-BSIWFzAA.js";
2
2
  export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
3
  "type": "module",
4
- "version": "5.2.14",
5
- "description": " tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
4
+ "version": "5.3.0",
5
+ "description": "Bring Tailwind CSS to every platform! Tailwind CSS 的原子化开发体验带到全端!",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
8
8
  "homepage": "https://tw.icebreaker.top",
@@ -154,12 +154,7 @@
154
154
  ]
155
155
  }
156
156
  },
157
- "bin": {
158
- "weapp-tailwindcss": "bin/weapp-tailwindcss.cjs",
159
- "weapp-tw": "bin/weapp-tailwindcss.cjs"
160
- },
161
157
  "files": [
162
- "bin",
163
158
  "css",
164
159
  "dist",
165
160
  "generator-placeholder.css",
@@ -207,6 +202,7 @@
207
202
  "debug": "~4.4.3",
208
203
  "fast-glob": "^3.3.3",
209
204
  "htmlparser2": "^12.0.0",
205
+ "lightningcss": "^1.33.0",
210
206
  "local-pkg": "^1.2.1",
211
207
  "lru-cache": "11.5.2",
212
208
  "magic-string": "^1.1.0",
@@ -215,12 +211,12 @@
215
211
  "oxc-walker": "^1.1.1",
216
212
  "semver": "~7.8.5",
217
213
  "yaml": "^2.9.0",
218
- "@weapp-tailwindcss/logger": "2.0.1",
219
- "@weapp-tailwindcss/reset": "0.1.2",
220
- "@weapp-tailwindcss/postcss": "3.2.10",
221
- "@weapp-tailwindcss/shared": "2.0.1",
222
- "tailwindcss-config": "2.0.2",
223
- "weapp-style-injector": "1.0.2"
214
+ "@weapp-tailwindcss/logger": "2.0.2",
215
+ "@weapp-tailwindcss/postcss": "3.2.11",
216
+ "@weapp-tailwindcss/reset": "0.1.3",
217
+ "@weapp-tailwindcss/shared": "2.0.2",
218
+ "tailwindcss-config": "2.0.3",
219
+ "weapp-style-injector": "1.0.3"
224
220
  },
225
221
  "devDependencies": {
226
222
  "@mpxjs/webpack-plugin": "^2.11.1",
@@ -231,7 +227,6 @@
231
227
  "build": "tsdown && tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist --noEmit false && tsx ../../tools/weapp-tailwindcss-scripts/src/rewrite-dts-aliases.ts && tsx ../../tools/weapp-tailwindcss-scripts/src/create-entry-dts.ts && tsx ../../tools/weapp-tailwindcss-scripts/src/ensure-escape-dts.ts",
232
228
  "build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist --noEmit false && tsx ../../tools/weapp-tailwindcss-scripts/src/rewrite-dts-aliases.ts && tsx ../../tools/weapp-tailwindcss-scripts/src/create-entry-dts.ts",
233
229
  "build:tsc": "cross-env NODE_ENV=development tsc --build tsconfig.json",
234
- "build:cli": "cd plugins/cli && pnpm run build",
235
230
  "build:css": "pnpm --filter @weapp-tailwindcss/scripts build:css",
236
231
  "build:weapp-theme": "pnpm --filter @weapp-tailwindcss/scripts build:weapp-theme",
237
232
  "test": "vitest run",
package/README.en.md DELETED
@@ -1,17 +0,0 @@
1
- # weapp-tailwindcss
2
-
3
- > English | [简体中文](./README.md)
4
-
5
- This is the core package that brings Tailwind CSS to mini program ecosystems, handling class transformation, CSS compatibility, framework build adapters, and Tailwind v4 support.
6
-
7
- ## Website
8
-
9
- For setup guides, configuration references, and framework examples, see the [official weapp-tailwindcss documentation](https://tw.icebreaker.top).
10
-
11
- For Tailwind CSS 4 projects, the entry CSS must still be imported by the application. Configure `cssEntries` explicitly with absolute paths resolved from the project root, but do not treat it as a replacement for importing the CSS entry into the build graph.
12
-
13
- ## Runtime requirements
14
-
15
- Starting with `weapp-tailwindcss@5.2.0`, Node.js `>=22.12.0` is required. This is the first Node.js 22 release where loading ESM from CommonJS is enabled by default.
16
-
17
- When using `uni-app` or `uni-app x` through HBuilderX, HBuilderX `>=5.11` is also required. Older HBuilderX releases may bundle a Node.js runtime that cannot load the current ESM dependencies.
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- const fs = require('node:fs')
3
- const path = require('node:path')
4
-
5
- const cliPath = path.resolve(__dirname, '../dist/cli.cjs')
6
- if (fs.existsSync(cliPath)) {
7
- require(cliPath)
8
- }
@@ -1,3 +0,0 @@
1
- import type { UserDefinedOptions } from '../types/index.js';
2
- export declare function createCliContext(overrides: Partial<UserDefinedOptions> | undefined, resolvedCwd: string | undefined): import("../types/index.js").InternalUserDefinedOptions;
3
- export declare function formatOutputPath(target: string, baseDir?: string): string;
@@ -1,7 +0,0 @@
1
- export declare const CONFIG_FILES: {
2
- tailwind: string[];
3
- postcss: string[];
4
- vite: string[];
5
- webpack: string[];
6
- };
7
- export declare const FRAMEWORK_DEPS: Array<[string, string]>;
@@ -1,31 +0,0 @@
1
- export type DoctorCheckStatus = 'ok' | 'warn' | 'error' | 'info';
2
- export interface DoctorCheck {
3
- id: string;
4
- title: string;
5
- status: DoctorCheckStatus;
6
- message: string;
7
- suggestion?: string | undefined;
8
- }
9
- export interface DoctorReport {
10
- cwd: string;
11
- nodeVersion: string;
12
- detected: {
13
- packageManager?: string | undefined;
14
- frameworks: string[];
15
- tailwindcssVersion?: string | undefined;
16
- weappTailwindcssVersion?: string | undefined;
17
- };
18
- summary: Record<DoctorCheckStatus, number>;
19
- checks: DoctorCheck[];
20
- }
21
- export interface DoctorOptions {
22
- cwd?: string | undefined;
23
- nodeVersion?: string | undefined;
24
- }
25
- export interface PackageJson {
26
- dependencies?: Record<string, string> | undefined;
27
- devDependencies?: Record<string, string> | undefined;
28
- optionalDependencies?: Record<string, string> | undefined;
29
- peerDependencies?: Record<string, string> | undefined;
30
- packageManager?: string | undefined;
31
- }
@@ -1,4 +0,0 @@
1
- import type { DoctorOptions, DoctorReport } from './doctor/types.js';
2
- export declare function createDoctorReport(options?: DoctorOptions): DoctorReport;
3
- export declare function hasDoctorFailure(report: DoctorReport, strict?: boolean): boolean;
4
- export declare function formatDoctorReport(report: DoctorReport): string;