weapp-tailwindcss 4.7.4 → 4.7.5-alpha.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.
@@ -582,7 +582,15 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
582
582
  if (!/\.(?:uvue|nvue)(?:\?.*)?$/.test(id)) {
583
583
  return;
584
584
  }
585
- const currentRuntimeSet = await ensureRuntimeClassSet();
585
+ const isServeCommand = _optionalChain([resolvedConfig, 'optionalAccess', _13 => _13.command]) === "serve";
586
+ const isWatchBuild = _optionalChain([resolvedConfig, 'optionalAccess', _14 => _14.command]) === "build" && !!_optionalChain([resolvedConfig, 'access', _15 => _15.build, 'optionalAccess', _16 => _16.watch]);
587
+ const shouldForceRefresh = isServeCommand || isWatchBuild;
588
+ let currentRuntimeSet;
589
+ if (shouldForceRefresh) {
590
+ currentRuntimeSet = await ensureRuntimeClassSet(true);
591
+ } else {
592
+ currentRuntimeSet = await ensureRuntimeClassSet();
593
+ }
586
594
  const extraOptions = customAttributesEntities.length > 0 || disabledDefaultTemplateHandler ? {
587
595
  customAttributesEntities,
588
596
  disabledDefaultTemplateHandler
@@ -591,6 +599,24 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
591
599
  return transformUVue(code, id, jsHandler, currentRuntimeSet, extraOptions);
592
600
  }
593
601
  return transformUVue(code, id, jsHandler, currentRuntimeSet);
602
+ },
603
+ async handleHotUpdate(ctx) {
604
+ if (_optionalChain([resolvedConfig, 'optionalAccess', _17 => _17.command]) !== "serve") {
605
+ return;
606
+ }
607
+ if (!/\.(?:uvue|nvue)$/.test(ctx.file)) {
608
+ return;
609
+ }
610
+ await ensureRuntimeClassSet(true);
611
+ },
612
+ async watchChange(id) {
613
+ if (_optionalChain([resolvedConfig, 'optionalAccess', _18 => _18.command]) !== "build" || !_optionalChain([resolvedConfig, 'access', _19 => _19.build, 'optionalAccess', _20 => _20.watch])) {
614
+ return;
615
+ }
616
+ if (!/\.(?:uvue|nvue)(?:\?.*)?$/.test(id)) {
617
+ return;
618
+ }
619
+ await ensureRuntimeClassSet(true);
594
620
  }
595
621
  }
596
622
  );
@@ -582,7 +582,15 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
582
582
  if (!/\.(?:uvue|nvue)(?:\?.*)?$/.test(id)) {
583
583
  return;
584
584
  }
585
- const currentRuntimeSet = await ensureRuntimeClassSet();
585
+ const isServeCommand = resolvedConfig?.command === "serve";
586
+ const isWatchBuild = resolvedConfig?.command === "build" && !!resolvedConfig.build?.watch;
587
+ const shouldForceRefresh = isServeCommand || isWatchBuild;
588
+ let currentRuntimeSet;
589
+ if (shouldForceRefresh) {
590
+ currentRuntimeSet = await ensureRuntimeClassSet(true);
591
+ } else {
592
+ currentRuntimeSet = await ensureRuntimeClassSet();
593
+ }
586
594
  const extraOptions = customAttributesEntities.length > 0 || disabledDefaultTemplateHandler ? {
587
595
  customAttributesEntities,
588
596
  disabledDefaultTemplateHandler
@@ -591,6 +599,24 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
591
599
  return transformUVue(code, id, jsHandler, currentRuntimeSet, extraOptions);
592
600
  }
593
601
  return transformUVue(code, id, jsHandler, currentRuntimeSet);
602
+ },
603
+ async handleHotUpdate(ctx) {
604
+ if (resolvedConfig?.command !== "serve") {
605
+ return;
606
+ }
607
+ if (!/\.(?:uvue|nvue)$/.test(ctx.file)) {
608
+ return;
609
+ }
610
+ await ensureRuntimeClassSet(true);
611
+ },
612
+ async watchChange(id) {
613
+ if (resolvedConfig?.command !== "build" || !resolvedConfig.build?.watch) {
614
+ return;
615
+ }
616
+ if (!/\.(?:uvue|nvue)(?:\?.*)?$/.test(id)) {
617
+ return;
618
+ }
619
+ await ensureRuntimeClassSet(true);
594
620
  }
595
621
  }
596
622
  );
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ require('./chunk-6GP37C26.js');
8
8
  var _chunkHMTZ4JJNjs = require('./chunk-HMTZ4JJN.js');
9
9
 
10
10
 
11
- var _chunkI6FBWASFjs = require('./chunk-I6FBWASF.js');
11
+ var _chunkGUCFNE5Ujs = require('./chunk-GUCFNE5U.js');
12
12
  require('./chunk-W7BVY5S5.js');
13
13
  require('./chunk-LTJQUORK.js');
14
14
  require('./chunk-BUMQQPAO.js');
@@ -22,4 +22,4 @@ require('./chunk-R7GWRQDJ.js');
22
22
 
23
23
 
24
24
 
25
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkI6FBWASFjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkT5BSWDY2js.UnifiedWebpackPluginV5; exports.createPlugins = _chunkHMTZ4JJNjs.createPlugins;
25
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkGUCFNE5Ujs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkT5BSWDY2js.UnifiedWebpackPluginV5; exports.createPlugins = _chunkHMTZ4JJNjs.createPlugins;
package/dist/index.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-JII7EQ6K.mjs";
9
9
  import {
10
10
  UnifiedViteWeappTailwindcssPlugin
11
- } from "./chunk-6IYMPBCH.mjs";
11
+ } from "./chunk-NGTZQLCI.mjs";
12
12
  import "./chunk-KZUIVLPP.mjs";
13
13
  import "./chunk-RRHPTTCP.mjs";
14
14
  import "./chunk-667CYXAH.mjs";
package/dist/vite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkI6FBWASFjs = require('./chunk-I6FBWASF.js');
3
+ var _chunkGUCFNE5Ujs = require('./chunk-GUCFNE5U.js');
4
4
  require('./chunk-W7BVY5S5.js');
5
5
  require('./chunk-LTJQUORK.js');
6
6
  require('./chunk-BUMQQPAO.js');
@@ -12,4 +12,4 @@ require('./chunk-UW3WHSZ5.js');
12
12
  require('./chunk-R7GWRQDJ.js');
13
13
 
14
14
 
15
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkI6FBWASFjs.UnifiedViteWeappTailwindcssPlugin;
15
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkGUCFNE5Ujs.UnifiedViteWeappTailwindcssPlugin;
package/dist/vite.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  UnifiedViteWeappTailwindcssPlugin
3
- } from "./chunk-6IYMPBCH.mjs";
3
+ } from "./chunk-NGTZQLCI.mjs";
4
4
  import "./chunk-KZUIVLPP.mjs";
5
5
  import "./chunk-RRHPTTCP.mjs";
6
6
  import "./chunk-667CYXAH.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
- "version": "4.7.4",
3
+ "version": "4.7.5-alpha.0",
4
4
  "description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -178,8 +178,8 @@
178
178
  "tailwindcss-patch": "^8.2.1",
179
179
  "webpack-sources": "3.3.3",
180
180
  "@weapp-tailwindcss/logger": "1.1.0",
181
- "@weapp-tailwindcss/shared": "1.1.0",
182
- "@weapp-tailwindcss/postcss": "2.0.2"
181
+ "@weapp-tailwindcss/postcss": "2.0.2",
182
+ "@weapp-tailwindcss/shared": "1.1.0"
183
183
  },
184
184
  "scripts": {
185
185
  "dev": "tsup --watch --sourcemap",