@csszyx/unplugin 0.10.6 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const cssMangler = require('./css-mangler.cjs');
6
- const unplugin = require('./shared/unplugin.CjxItfV1.cjs');
6
+ const unplugin = require('./shared/unplugin.CaH_X1dP.cjs');
7
7
  const types = require('@csszyx/types');
8
8
  require('postcss');
9
9
  require('postcss-selector-parser');
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.cjs';
2
2
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
3
- import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.DzA2Mwc7.cjs';
3
+ import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.DjIGzbic.cjs';
4
4
  // @ts-ignore
5
5
  export = undefined;
6
- export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as appendTailwindSourceDirective, p as computeSafelistRelPath, q as createGlobalVarMapAssetSource, r as cssHasContentScope, s as cssImportsTailwind, t as esbuildPlugin, v as extractGlobalVarAliasesForManifest, w as fileMayContainSafelistableSz, x as hasInjectableTailwindCandidate, y as isCompileSourceOptedIn, z as isHardIgnoredPath, A as isMonorepoPackage, B as isPackagesSkippedSource, D as mangleCodeClassesSync, E as missingTailwindEntryMessage, F as normalizeGlobalVarAliasesForCache, H as resolveCompileSourceDirs, I as resolveNativeCacheIdentity, J as rollupPlugin, K as shouldEmitWarning, L as shouldWarnMissingTailwindEntry, M as shouldWarnUnscopedMonorepo, N as skippedSzFilesMessage, u as unplugin, O as unscopedMonorepoMessage, Q as vitePlugin, T as webpackPlugin } from './shared/unplugin.DzA2Mwc7.cjs';
6
+ export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as appendTailwindSourceDirective, p as computeSafelistRelPath, q as createGlobalVarMapAssetSource, r as cssHasContentScope, s as cssImportsTailwind, t as esbuildPlugin, v as extractGlobalVarAliasesForManifest, w as fileMayContainSafelistableSz, x as hasInjectableTailwindCandidate, y as isCompileSourceOptedIn, z as isHardIgnoredPath, A as isMonorepoPackage, B as isPackagesSkippedSource, D as mangleCodeClassesSync, E as missingTailwindEntryMessage, F as normalizeGlobalVarAliasesForCache, H as resolveCompileSourceDirs, I as resolveNativeCacheIdentity, J as rollupPlugin, K as shouldEmitWarning, L as shouldWarnMissingTailwindEntry, M as shouldWarnUnscopedMonorepo, N as skippedSzFilesMessage, u as unplugin, O as unscopedMonorepoMessage, Q as vitePlugin, T as webpackPlugin } from './shared/unplugin.DjIGzbic.cjs';
7
7
  import 'postcss';
8
8
  import '@csszyx/compiler';
9
9
  import 'esbuild';
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
2
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
3
- import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.DzA2Mwc7.mjs';
4
- export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as appendTailwindSourceDirective, p as computeSafelistRelPath, q as createGlobalVarMapAssetSource, r as cssHasContentScope, s as cssImportsTailwind, u as default, t as esbuildPlugin, v as extractGlobalVarAliasesForManifest, w as fileMayContainSafelistableSz, x as hasInjectableTailwindCandidate, y as isCompileSourceOptedIn, z as isHardIgnoredPath, A as isMonorepoPackage, B as isPackagesSkippedSource, D as mangleCodeClassesSync, E as missingTailwindEntryMessage, F as normalizeGlobalVarAliasesForCache, H as resolveCompileSourceDirs, I as resolveNativeCacheIdentity, J as rollupPlugin, K as shouldEmitWarning, L as shouldWarnMissingTailwindEntry, M as shouldWarnUnscopedMonorepo, N as skippedSzFilesMessage, u as unplugin, O as unscopedMonorepoMessage, Q as vitePlugin, T as webpackPlugin } from './shared/unplugin.DzA2Mwc7.mjs';
3
+ import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.DjIGzbic.mjs';
4
+ export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as appendTailwindSourceDirective, p as computeSafelistRelPath, q as createGlobalVarMapAssetSource, r as cssHasContentScope, s as cssImportsTailwind, u as default, t as esbuildPlugin, v as extractGlobalVarAliasesForManifest, w as fileMayContainSafelistableSz, x as hasInjectableTailwindCandidate, y as isCompileSourceOptedIn, z as isHardIgnoredPath, A as isMonorepoPackage, B as isPackagesSkippedSource, D as mangleCodeClassesSync, E as missingTailwindEntryMessage, F as normalizeGlobalVarAliasesForCache, H as resolveCompileSourceDirs, I as resolveNativeCacheIdentity, J as rollupPlugin, K as shouldEmitWarning, L as shouldWarnMissingTailwindEntry, M as shouldWarnUnscopedMonorepo, N as skippedSzFilesMessage, u as unplugin, O as unscopedMonorepoMessage, Q as vitePlugin, T as webpackPlugin } from './shared/unplugin.DjIGzbic.mjs';
5
5
  import 'postcss';
6
6
  import '@csszyx/compiler';
7
7
  import 'esbuild';
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
- export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as computeSafelistRelPath, e as createGlobalVarAliasValidationOptions, f as createGlobalVarMapAssetSource, g as createGlobalVarScanCacheKey, h as createRSCModuleRecord, i as cssHasContentScope, j as cssImportsTailwind, u as default, k as deleteRSCModuleRecord, l as esbuildPlugin, m as extractGlobalVarAliasesForManifest, n as fileMayContainSafelistableSz, o as findRSCBoundaryViolation, p as findRSCGraphViolation, q as hasInjectableTailwindCandidate, r as hasTokens, s as hasUseClientDirective, t as hasUseServerDirective, v as isCompileSourceOptedIn, w as isHardIgnoredPath, x as isMonorepoPackage, y as isPackagesSkippedSource, z as isRSCServerModule, A as isTailwindReservedGlobalVar, B as mangleCodeClassesSync, C as mergeThemes, D as missingTailwindEntryMessage, E as normalizeGlobalVarAliasesForCache, F as parseThemeBlocks, G as planGlobalVarAliases, H as readGlobalVarScanCache, I as resolveCompileSourceDirs, J as resolveGlobalVarScanCacheDir, K as resolveNativeCacheIdentity, L as rewriteGlobalVarCssAliases, M as rollupPlugin, N as scanGlobalVarCss, O as shouldEmitWarning, P as shouldWarnMissingTailwindEntry, Q as shouldWarnUnscopedMonorepo, R as skippedSzFilesMessage, u as unplugin, S as unscopedMonorepoMessage, T as validateGlobalVarAliasInputs, U as vitePlugin, V as webpackPlugin, W as writeGlobalVarScanCache } from './shared/unplugin.CDjxWs9r.mjs';
2
+ export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as computeSafelistRelPath, e as createGlobalVarAliasValidationOptions, f as createGlobalVarMapAssetSource, g as createGlobalVarScanCacheKey, h as createRSCModuleRecord, i as cssHasContentScope, j as cssImportsTailwind, u as default, k as deleteRSCModuleRecord, l as esbuildPlugin, m as extractGlobalVarAliasesForManifest, n as fileMayContainSafelistableSz, o as findRSCBoundaryViolation, p as findRSCGraphViolation, q as hasInjectableTailwindCandidate, r as hasTokens, s as hasUseClientDirective, t as hasUseServerDirective, v as isCompileSourceOptedIn, w as isHardIgnoredPath, x as isMonorepoPackage, y as isPackagesSkippedSource, z as isRSCServerModule, A as isTailwindReservedGlobalVar, B as mangleCodeClassesSync, C as mergeThemes, D as missingTailwindEntryMessage, E as normalizeGlobalVarAliasesForCache, F as parseThemeBlocks, G as planGlobalVarAliases, H as readGlobalVarScanCache, I as resolveCompileSourceDirs, J as resolveGlobalVarScanCacheDir, K as resolveNativeCacheIdentity, L as rewriteGlobalVarCssAliases, M as rollupPlugin, N as scanGlobalVarCss, O as shouldEmitWarning, P as shouldWarnMissingTailwindEntry, Q as shouldWarnUnscopedMonorepo, R as skippedSzFilesMessage, u as unplugin, S as unscopedMonorepoMessage, T as validateGlobalVarAliasInputs, U as vitePlugin, V as webpackPlugin, W as writeGlobalVarScanCache } from './shared/unplugin.D_GIYc2p.mjs';
3
3
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
4
4
  import 'postcss';
5
5
  import 'postcss-selector-parser';
@@ -1609,9 +1609,9 @@ const RUNTIME_HELPER_IMPORT_RE = {
1609
1609
  let _hasWarnedTsConfig = false;
1610
1610
  let _hasWarnedTransformCacheVersion = false;
1611
1611
  let _hasWarnedNativeFallback = false;
1612
- const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CjxItfV1.cjs', document.baseURI).href)));
1612
+ const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CaH_X1dP.cjs', document.baseURI).href)));
1613
1613
  const PLUGIN_VERSION = findPackageVersionFromFile(
1614
- node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CjxItfV1.cjs', document.baseURI).href))),
1614
+ node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CaH_X1dP.cjs', document.baseURI).href))),
1615
1615
  UNKNOWN_PACKAGE_VERSION
1616
1616
  );
1617
1617
  const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
@@ -1682,8 +1682,8 @@ function hasInjectableTailwindCandidate(classes) {
1682
1682
  }
1683
1683
  return false;
1684
1684
  }
1685
- function shouldWarnMissingTailwindEntry(ownedClassCount, sawTailwindEntry) {
1686
- return ownedClassCount > 0 && !sawTailwindEntry;
1685
+ function shouldWarnMissingTailwindEntry(ownedClassCount, sawTailwindEntry, sawAnyCss) {
1686
+ return ownedClassCount > 0 && sawAnyCss && !sawTailwindEntry;
1687
1687
  }
1688
1688
  function missingTailwindEntryMessage(ownedClassCount) {
1689
1689
  return `[csszyx] generated ${ownedClassCount} sz class(es) but found no CSS entry importing "tailwindcss" \u2014 those classes will produce no CSS. Import "tailwindcss" in a CSS file (csszyx auto-injects @source for the generated classes) so Tailwind emits their styles.`;
@@ -2412,7 +2412,7 @@ ${errors.join("\n")}`
2412
2412
  }
2413
2413
  function createCsszyxPlugins(options = {}) {
2414
2414
  assertGlobalVarMangleConfig(options);
2415
- const manglingEnabled = options.production?.mangle !== false;
2415
+ let manglingEnabled = options.production?.mangle !== false;
2416
2416
  const astBudgetOverride = options.build?.astBudgetLimit;
2417
2417
  const cacheRequested = (options.build?.cache ?? types.DEFAULT_BUILD_CONFIG.cache) !== false;
2418
2418
  const cacheVersionsKnown = PLUGIN_VERSION !== UNKNOWN_PACKAGE_VERSION && COMPILER_VERSION !== UNKNOWN_PACKAGE_VERSION;
@@ -2455,6 +2455,7 @@ function createCsszyxPlugins(options = {}) {
2455
2455
  const state = {
2456
2456
  classes: /* @__PURE__ */ new Set(),
2457
2457
  sawTailwindEntry: false,
2458
+ sawAnyCss: false,
2458
2459
  tailwindWarningEmitted: false,
2459
2460
  tailwindEntryScoped: false,
2460
2461
  contentScopeWarningEmitted: false,
@@ -2604,7 +2605,9 @@ function createCsszyxPlugins(options = {}) {
2604
2605
  astBudget: astBudgetOverride,
2605
2606
  mangleVars: options.production?.mangleVars === true,
2606
2607
  mangleVarHoistMaxDepth: options.production?.mangleVarHoistMaxDepth,
2607
- globalVarAliases: earlyGlobalVarAliasEntries.length > 0 ? earlyGlobalVarAliasEntries : void 0
2608
+ globalVarAliases: earlyGlobalVarAliasEntries.length > 0 ? earlyGlobalVarAliasEntries : void 0,
2609
+ // Render dev-mode unknown-property warnings relative to the project root.
2610
+ rootDir: state.rootDir
2608
2611
  };
2609
2612
  }
2610
2613
  function createConfiguredTransformCacheInput(source, effectiveFilename, compilerOptions) {
@@ -3073,6 +3076,7 @@ function createCsszyxPlugins(options = {}) {
3073
3076
  assertNoRSCBoundaryViolation(code, id);
3074
3077
  }
3075
3078
  if (/\.css(\?.*)?$/.test(id)) {
3079
+ state.sawAnyCss = true;
3076
3080
  if (cssImportsTailwind(code)) {
3077
3081
  state.sawTailwindEntry = true;
3078
3082
  if (cssHasContentScope(code)) {
@@ -3218,7 +3222,11 @@ function createCsszyxPlugins(options = {}) {
3218
3222
  buildEnd() {
3219
3223
  finalizeMangleMap();
3220
3224
  assertNoRSCGraphViolation(state.rscModules);
3221
- if (!state.tailwindWarningEmitted && shouldWarnMissingTailwindEntry(state.ownedClasses.size, state.sawTailwindEntry)) {
3225
+ if (!state.tailwindWarningEmitted && shouldWarnMissingTailwindEntry(
3226
+ state.ownedClasses.size,
3227
+ state.sawTailwindEntry,
3228
+ state.sawAnyCss
3229
+ )) {
3222
3230
  state.tailwindWarningEmitted = true;
3223
3231
  emitWarning(missingTailwindEntryMessage(state.ownedClasses.size));
3224
3232
  }
@@ -3294,6 +3302,9 @@ function createCsszyxPlugins(options = {}) {
3294
3302
  configResolved(config) {
3295
3303
  const root = config.root || process.cwd();
3296
3304
  state.rootDir = root;
3305
+ if (config.command === "serve") {
3306
+ manglingEnabled = false;
3307
+ }
3297
3308
  evictTransformCacheOnce();
3298
3309
  prescanAndWriteClasses();
3299
3310
  runThemeScan(root, options.build?.scanCss);
@@ -3373,7 +3384,8 @@ function createCsszyxPlugins(options = {}) {
3373
3384
  */
3374
3385
  handler(html) {
3375
3386
  finalizeMangleMap();
3376
- let result = transformIndexHtml(html, state.mangleMap, state.checksum, {
3387
+ const injectedMangleMap = manglingEnabled ? state.mangleMap : {};
3388
+ let result = transformIndexHtml(html, injectedMangleMap, state.checksum, {
3377
3389
  mode: options.production?.injectChecksum === false ? "script" : "script",
3378
3390
  minify: process.env.NODE_ENV === "production",
3379
3391
  varMangleMap: state.varMangleMap,
@@ -1662,8 +1662,8 @@ function hasInjectableTailwindCandidate(classes) {
1662
1662
  }
1663
1663
  return false;
1664
1664
  }
1665
- function shouldWarnMissingTailwindEntry(ownedClassCount, sawTailwindEntry) {
1666
- return ownedClassCount > 0 && !sawTailwindEntry;
1665
+ function shouldWarnMissingTailwindEntry(ownedClassCount, sawTailwindEntry, sawAnyCss) {
1666
+ return ownedClassCount > 0 && sawAnyCss && !sawTailwindEntry;
1667
1667
  }
1668
1668
  function missingTailwindEntryMessage(ownedClassCount) {
1669
1669
  return `[csszyx] generated ${ownedClassCount} sz class(es) but found no CSS entry importing "tailwindcss" \u2014 those classes will produce no CSS. Import "tailwindcss" in a CSS file (csszyx auto-injects @source for the generated classes) so Tailwind emits their styles.`;
@@ -2392,7 +2392,7 @@ ${errors.join("\n")}`
2392
2392
  }
2393
2393
  function createCsszyxPlugins(options = {}) {
2394
2394
  assertGlobalVarMangleConfig(options);
2395
- const manglingEnabled = options.production?.mangle !== false;
2395
+ let manglingEnabled = options.production?.mangle !== false;
2396
2396
  const astBudgetOverride = options.build?.astBudgetLimit;
2397
2397
  const cacheRequested = (options.build?.cache ?? DEFAULT_BUILD_CONFIG.cache) !== false;
2398
2398
  const cacheVersionsKnown = PLUGIN_VERSION !== UNKNOWN_PACKAGE_VERSION && COMPILER_VERSION !== UNKNOWN_PACKAGE_VERSION;
@@ -2435,6 +2435,7 @@ function createCsszyxPlugins(options = {}) {
2435
2435
  const state = {
2436
2436
  classes: /* @__PURE__ */ new Set(),
2437
2437
  sawTailwindEntry: false,
2438
+ sawAnyCss: false,
2438
2439
  tailwindWarningEmitted: false,
2439
2440
  tailwindEntryScoped: false,
2440
2441
  contentScopeWarningEmitted: false,
@@ -2584,7 +2585,9 @@ function createCsszyxPlugins(options = {}) {
2584
2585
  astBudget: astBudgetOverride,
2585
2586
  mangleVars: options.production?.mangleVars === true,
2586
2587
  mangleVarHoistMaxDepth: options.production?.mangleVarHoistMaxDepth,
2587
- globalVarAliases: earlyGlobalVarAliasEntries.length > 0 ? earlyGlobalVarAliasEntries : void 0
2588
+ globalVarAliases: earlyGlobalVarAliasEntries.length > 0 ? earlyGlobalVarAliasEntries : void 0,
2589
+ // Render dev-mode unknown-property warnings relative to the project root.
2590
+ rootDir: state.rootDir
2588
2591
  };
2589
2592
  }
2590
2593
  function createConfiguredTransformCacheInput(source, effectiveFilename, compilerOptions) {
@@ -3053,6 +3056,7 @@ function createCsszyxPlugins(options = {}) {
3053
3056
  assertNoRSCBoundaryViolation(code, id);
3054
3057
  }
3055
3058
  if (/\.css(\?.*)?$/.test(id)) {
3059
+ state.sawAnyCss = true;
3056
3060
  if (cssImportsTailwind(code)) {
3057
3061
  state.sawTailwindEntry = true;
3058
3062
  if (cssHasContentScope(code)) {
@@ -3198,7 +3202,11 @@ function createCsszyxPlugins(options = {}) {
3198
3202
  buildEnd() {
3199
3203
  finalizeMangleMap();
3200
3204
  assertNoRSCGraphViolation(state.rscModules);
3201
- if (!state.tailwindWarningEmitted && shouldWarnMissingTailwindEntry(state.ownedClasses.size, state.sawTailwindEntry)) {
3205
+ if (!state.tailwindWarningEmitted && shouldWarnMissingTailwindEntry(
3206
+ state.ownedClasses.size,
3207
+ state.sawTailwindEntry,
3208
+ state.sawAnyCss
3209
+ )) {
3202
3210
  state.tailwindWarningEmitted = true;
3203
3211
  emitWarning(missingTailwindEntryMessage(state.ownedClasses.size));
3204
3212
  }
@@ -3274,6 +3282,9 @@ function createCsszyxPlugins(options = {}) {
3274
3282
  configResolved(config) {
3275
3283
  const root = config.root || process.cwd();
3276
3284
  state.rootDir = root;
3285
+ if (config.command === "serve") {
3286
+ manglingEnabled = false;
3287
+ }
3277
3288
  evictTransformCacheOnce();
3278
3289
  prescanAndWriteClasses();
3279
3290
  runThemeScan(root, options.build?.scanCss);
@@ -3353,7 +3364,8 @@ function createCsszyxPlugins(options = {}) {
3353
3364
  */
3354
3365
  handler(html) {
3355
3366
  finalizeMangleMap();
3356
- let result = transformIndexHtml(html, state.mangleMap, state.checksum, {
3367
+ const injectedMangleMap = manglingEnabled ? state.mangleMap : {};
3368
+ let result = transformIndexHtml(html, injectedMangleMap, state.checksum, {
3357
3369
  mode: options.production?.injectChecksum === false ? "script" : "script",
3358
3370
  minify: process.env.NODE_ENV === "production",
3359
3371
  varMangleMap: state.varMangleMap,
@@ -271,9 +271,14 @@ declare function hasInjectableTailwindCandidate(classes: Iterable<string>): bool
271
271
  *
272
272
  * @param ownedClassCount - number of csszyx-generated classes this build produced.
273
273
  * @param sawTailwindEntry - whether any processed CSS imported tailwindcss.
274
+ * @param sawAnyCss - whether ANY CSS file passed through the transform hook. When
275
+ * false, csszyx never observed the CSS pipeline (e.g. `astro check`, an early
276
+ * Astro build phase, or CSS handled outside this hook) and cannot conclude the
277
+ * entry is missing — so it stays silent rather than false-positive on a build
278
+ * that does emit valid CSS.
274
279
  * @returns true when the missing-entry warning should fire.
275
280
  */
276
- declare function shouldWarnMissingTailwindEntry(ownedClassCount: number, sawTailwindEntry: boolean): boolean;
281
+ declare function shouldWarnMissingTailwindEntry(ownedClassCount: number, sawTailwindEntry: boolean, sawAnyCss: boolean): boolean;
277
282
  /**
278
283
  * Build the missing-Tailwind-entry warning message.
279
284
  * @param ownedClassCount - number of csszyx-generated classes this build produced.
@@ -271,9 +271,14 @@ declare function hasInjectableTailwindCandidate(classes: Iterable<string>): bool
271
271
  *
272
272
  * @param ownedClassCount - number of csszyx-generated classes this build produced.
273
273
  * @param sawTailwindEntry - whether any processed CSS imported tailwindcss.
274
+ * @param sawAnyCss - whether ANY CSS file passed through the transform hook. When
275
+ * false, csszyx never observed the CSS pipeline (e.g. `astro check`, an early
276
+ * Astro build phase, or CSS handled outside this hook) and cannot conclude the
277
+ * entry is missing — so it stays silent rather than false-positive on a build
278
+ * that does emit valid CSS.
274
279
  * @returns true when the missing-entry warning should fire.
275
280
  */
276
- declare function shouldWarnMissingTailwindEntry(ownedClassCount: number, sawTailwindEntry: boolean): boolean;
281
+ declare function shouldWarnMissingTailwindEntry(ownedClassCount: number, sawTailwindEntry: boolean, sawAnyCss: boolean): boolean;
277
282
  /**
278
283
  * Build the missing-Tailwind-entry warning message.
279
284
  * @param ownedClassCount - number of csszyx-generated classes this build produced.
package/dist/vite.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CjxItfV1.cjs');
5
+ const unplugin = require('./shared/unplugin.CaH_X1dP.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Q as vitePlugin } from './shared/unplugin.DzA2Mwc7.cjs';
1
+ import { Q as vitePlugin } from './shared/unplugin.DjIGzbic.cjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Q as vitePlugin } from './shared/unplugin.DzA2Mwc7.mjs';
1
+ import { Q as vitePlugin } from './shared/unplugin.DjIGzbic.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { U as vitePlugin } from './shared/unplugin.CDjxWs9r.mjs';
1
+ import { U as vitePlugin } from './shared/unplugin.D_GIYc2p.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
package/dist/webpack.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CjxItfV1.cjs');
5
+ const unplugin = require('./shared/unplugin.CaH_X1dP.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
@@ -1,4 +1,4 @@
1
- import { T as webpackPlugin } from './shared/unplugin.DzA2Mwc7.cjs';
1
+ import { T as webpackPlugin } from './shared/unplugin.DjIGzbic.cjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
@@ -1,4 +1,4 @@
1
- import { T as webpackPlugin } from './shared/unplugin.DzA2Mwc7.mjs';
1
+ import { T as webpackPlugin } from './shared/unplugin.DjIGzbic.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { V as webpackPlugin } from './shared/unplugin.CDjxWs9r.mjs';
1
+ import { V as webpackPlugin } from './shared/unplugin.D_GIYc2p.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.10.6",
3
+ "version": "0.10.7",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -117,14 +117,14 @@
117
117
  "postcss-value-parser": "^4.2.0",
118
118
  "proper-lockfile": "^4.1.2",
119
119
  "unplugin": "^1.10.1",
120
- "@csszyx/compiler": "0.10.6",
121
- "@csszyx/svelte-adapter": "0.10.6",
122
- "@csszyx/types": "0.10.6",
123
- "@csszyx/core": "0.10.6",
124
- "@csszyx/vue-adapter": "0.10.6"
120
+ "@csszyx/compiler": "0.10.7",
121
+ "@csszyx/svelte-adapter": "0.10.7",
122
+ "@csszyx/core": "0.10.7",
123
+ "@csszyx/vue-adapter": "0.10.7",
124
+ "@csszyx/types": "0.10.7"
125
125
  },
126
126
  "peerDependencies": {
127
- "@csszyx/runtime": "^0.10.6"
127
+ "@csszyx/runtime": "^0.10.7"
128
128
  },
129
129
  "devDependencies": {
130
130
  "@types/node": "^20.11.0",