weapp-tailwindcss 4.9.4 → 4.9.5

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 (51) hide show
  1. package/dist/{chunk-3IXWQT3G.mjs → chunk-2SD5C6P5.mjs} +2 -1
  2. package/dist/{chunk-WCM6ODS4.mjs → chunk-3NHQQWE3.mjs} +2 -2
  3. package/dist/{chunk-Z3A2XYUL.js → chunk-4H6IVC77.js} +24 -24
  4. package/dist/{chunk-KHBSYJ76.js → chunk-5PICNI6R.js} +3 -3
  5. package/dist/{chunk-AJDZJQNR.mjs → chunk-CCJHSRUV.mjs} +3 -3
  6. package/dist/{chunk-DKX737YI.js → chunk-CQSMFX4I.js} +13 -13
  7. package/dist/{chunk-XI2H73CF.mjs → chunk-DCYV3N3T.mjs} +1 -1
  8. package/dist/{chunk-MVOIVNKL.js → chunk-DUNUSQPW.js} +2 -1
  9. package/dist/{chunk-ZQ7ET56G.js → chunk-EHI5UUJ2.js} +3 -3
  10. package/dist/{chunk-6HOLMRXS.mjs → chunk-H3FNFKOH.mjs} +2 -2
  11. package/dist/{chunk-QAEALIIZ.mjs → chunk-SDVCC3VG.mjs} +1 -1
  12. package/dist/{chunk-EZWWOZAH.js → chunk-WNFPFNXO.js} +7 -7
  13. package/dist/cli.js +9 -9
  14. package/dist/cli.mjs +1 -1
  15. package/dist/core.d.mts +2 -1
  16. package/dist/core.d.ts +2 -1
  17. package/dist/core.js +8 -8
  18. package/dist/core.mjs +2 -2
  19. package/dist/defaults.d.mts +1 -3
  20. package/dist/defaults.d.ts +1 -3
  21. package/dist/gulp.d.mts +2 -1
  22. package/dist/gulp.d.ts +2 -1
  23. package/dist/gulp.js +4 -4
  24. package/dist/gulp.mjs +3 -3
  25. package/dist/index-D4tYbWC6.d.mts +590 -0
  26. package/dist/index-D4tYbWC6.d.ts +590 -0
  27. package/dist/index.d.mts +4 -3
  28. package/dist/index.d.ts +4 -3
  29. package/dist/index.js +8 -9
  30. package/dist/index.mjs +6 -7
  31. package/dist/presets.d.mts +1 -3
  32. package/dist/presets.d.ts +1 -3
  33. package/dist/types.d.mts +8 -600
  34. package/dist/types.d.ts +8 -600
  35. package/dist/types.js +1 -2
  36. package/dist/types.mjs +0 -1
  37. package/dist/vite.d.mts +1 -3
  38. package/dist/vite.d.ts +1 -3
  39. package/dist/vite.js +4 -4
  40. package/dist/vite.mjs +3 -3
  41. package/dist/webpack.d.mts +2 -1
  42. package/dist/webpack.d.ts +2 -1
  43. package/dist/webpack.js +5 -5
  44. package/dist/webpack.mjs +4 -4
  45. package/dist/webpack4.d.mts +2 -1
  46. package/dist/webpack4.d.ts +2 -1
  47. package/dist/webpack4.js +24 -24
  48. package/dist/webpack4.mjs +3 -3
  49. package/package.json +4 -3
  50. package/dist/chunk-O2IOQ3BD.js +0 -1
  51. package/dist/chunk-YAN7TO2B.mjs +0 -0
@@ -192,7 +192,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
192
192
  // package.json
193
193
  var package_default = {
194
194
  name: "weapp-tailwindcss",
195
- version: "4.9.4",
195
+ version: "4.9.5",
196
196
  description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
197
197
  author: "ice breaker <1324318532@qq.com>",
198
198
  license: "MIT",
@@ -363,6 +363,7 @@ var package_default = {
363
363
  bench: "vitest bench --config ./vitest.config.ts",
364
364
  "bench:js-handlers": "tsx scripts/js-bench.ts",
365
365
  "bench:js-diff": "tsx scripts/js-bench-diff.ts",
366
+ tsd: "tsd",
366
367
  clean: "tsx scripts/clean.ts",
367
368
  "get-decl": "tsx scripts/get-decl.ts",
368
369
  "ls:pack": "npm pack --dry-run",
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-RRHPTTCP.mjs";
13
13
  import {
14
14
  setupPatchRecorder
15
- } from "./chunk-QAEALIIZ.mjs";
15
+ } from "./chunk-SDVCC3VG.mjs";
16
16
  import {
17
17
  collectRuntimeClassSet,
18
18
  createAttributeMatcher,
@@ -23,7 +23,7 @@ import {
23
23
  replaceWxml,
24
24
  toCustomAttributesEntities,
25
25
  vitePluginName
26
- } from "./chunk-3IXWQT3G.mjs";
26
+ } from "./chunk-2SD5C6P5.mjs";
27
27
  import {
28
28
  getGroupedEntries,
29
29
  resolveUniUtsPlatform
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkKHBSYJ76js = require('./chunk-KHBSYJ76.js');
12
+ var _chunk5PICNI6Rjs = require('./chunk-5PICNI6R.js');
13
13
 
14
14
 
15
15
 
@@ -22,14 +22,14 @@ var _chunkVPHA77FHjs = require('./chunk-VPHA77FH.js');
22
22
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
23
23
 
24
24
 
25
- var _chunkZQ7ET56Gjs = require('./chunk-ZQ7ET56G.js');
25
+ var _chunkEHI5UUJ2js = require('./chunk-EHI5UUJ2.js');
26
26
 
27
27
 
28
28
 
29
29
 
30
30
 
31
31
 
32
- var _chunkMVOIVNKLjs = require('./chunk-MVOIVNKL.js');
32
+ var _chunkDUNUSQPWjs = require('./chunk-DUNUSQPW.js');
33
33
 
34
34
 
35
35
  var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
@@ -51,10 +51,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
51
51
  } = options;
52
52
  const { Compilation, sources } = compiler.webpack;
53
53
  const { ConcatSource } = sources;
54
- compiler.hooks.compilation.tap(_chunkMVOIVNKLjs.pluginName, (compilation) => {
54
+ compiler.hooks.compilation.tap(_chunkDUNUSQPWjs.pluginName, (compilation) => {
55
55
  compilation.hooks.processAssets.tapPromise(
56
56
  {
57
- name: _chunkMVOIVNKLjs.pluginName,
57
+ name: _chunkDUNUSQPWjs.pluginName,
58
58
  stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
59
59
  },
60
60
  async (assets) => {
@@ -123,7 +123,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
123
123
  const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
124
124
  await refreshRuntimeState(true);
125
125
  await runtimeState.patchPromise;
126
- const runtimeSet = await _chunkMVOIVNKLjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
126
+ const runtimeSet = await _chunkDUNUSQPWjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
127
127
  debug2("get runtimeSet, class count: %d", runtimeSet.size);
128
128
  const tasks = [];
129
129
  if (Array.isArray(groupedEntries.html)) {
@@ -160,7 +160,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
160
160
  const jsTaskFactories = [];
161
161
  if (Array.isArray(groupedEntries.js)) {
162
162
  for (const [file] of groupedEntries.js) {
163
- const cacheKey = _chunkKHBSYJ76js.getCacheKey.call(void 0, file);
163
+ const cacheKey = _chunk5PICNI6Rjs.getCacheKey.call(void 0, file);
164
164
  const asset = compilation.getAsset(file);
165
165
  if (!asset) {
166
166
  continue;
@@ -265,9 +265,9 @@ function setupWebpackV5Loaders(options) {
265
265
  getClassSetInLoader,
266
266
  debug: debug2
267
267
  } = options;
268
- const isMpxApp = _chunkKHBSYJ76js.isMpx.call(void 0, appType);
268
+ const isMpxApp = _chunk5PICNI6Rjs.isMpx.call(void 0, appType);
269
269
  if (shouldRewriteCssImports && isMpxApp) {
270
- _chunkKHBSYJ76js.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
270
+ _chunk5PICNI6Rjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
271
271
  }
272
272
  const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
273
273
  const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
@@ -280,12 +280,12 @@ function setupWebpackV5Loaders(options) {
280
280
  const classSetLoaderOptions = {
281
281
  getClassSet: getClassSetInLoader
282
282
  };
283
- const { findRewriteAnchor, findClassSetAnchor } = _chunkKHBSYJ76js.createLoaderAnchorFinders.call(void 0, appType);
283
+ const { findRewriteAnchor, findClassSetAnchor } = _chunk5PICNI6Rjs.createLoaderAnchorFinders.call(void 0, appType);
284
284
  const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
285
285
  rewriteCssImports: runtimeLoaderRewriteOptions
286
286
  } : void 0;
287
287
  if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
288
- _chunkKHBSYJ76js.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
288
+ _chunk5PICNI6Rjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
289
289
  }
290
290
  const createRuntimeClassSetLoaderEntry = () => ({
291
291
  loader: runtimeClassSetLoader,
@@ -305,17 +305,17 @@ function setupWebpackV5Loaders(options) {
305
305
  };
306
306
  };
307
307
  const { NormalModule } = compiler.webpack;
308
- compiler.hooks.compilation.tap(_chunkMVOIVNKLjs.pluginName, (compilation) => {
309
- NormalModule.getCompilationHooks(compilation).loader.tap(_chunkMVOIVNKLjs.pluginName, (_loaderContext, module) => {
308
+ compiler.hooks.compilation.tap(_chunkDUNUSQPWjs.pluginName, (compilation) => {
309
+ NormalModule.getCompilationHooks(compilation).loader.tap(_chunkDUNUSQPWjs.pluginName, (_loaderContext, module) => {
310
310
  const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
311
311
  if (!hasRuntimeLoader) {
312
312
  return;
313
313
  }
314
- _chunkKHBSYJ76js.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
314
+ _chunk5PICNI6Rjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
315
315
  const loaderEntries = module.loaders || [];
316
316
  let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
317
317
  const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
318
- const isCssModule = _chunkKHBSYJ76js.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
318
+ const isCssModule = _chunk5PICNI6Rjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
319
319
  if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
320
320
  debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
321
321
  }
@@ -347,7 +347,7 @@ function setupWebpackV5Loaders(options) {
347
347
  rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
348
348
  }
349
349
  }
350
- if (runtimeClassSetLoaderExists && !_chunkKHBSYJ76js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
350
+ if (runtimeClassSetLoaderExists && !_chunk5PICNI6Rjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
351
351
  const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
352
352
  const anchorIndex = findClassSetAnchor(loaderEntries);
353
353
  if (anchorIndex === -1) {
@@ -362,11 +362,11 @@ function setupWebpackV5Loaders(options) {
362
362
  }
363
363
 
364
364
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
365
- var debug = _chunkMVOIVNKLjs.createDebug.call(void 0, );
365
+ var debug = _chunkDUNUSQPWjs.createDebug.call(void 0, );
366
366
  var weappTailwindcssPackageDir = _chunkVPHA77FHjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
367
367
  var UnifiedWebpackPluginV5 = class {
368
368
  constructor(options = {}) {
369
- this.options = _chunkMVOIVNKLjs.getCompilerContext.call(void 0, options);
369
+ this.options = _chunkDUNUSQPWjs.getCompilerContext.call(void 0, options);
370
370
  this.appType = this.options.appType;
371
371
  }
372
372
  apply(compiler) {
@@ -382,19 +382,19 @@ var UnifiedWebpackPluginV5 = class {
382
382
  const disabledOptions = _chunkVPHA77FHjs.resolveDisabledOptions.call(void 0, disabled);
383
383
  const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
384
384
  const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
385
- const isMpxApp = _chunkKHBSYJ76js.isMpx.call(void 0, this.appType);
385
+ const isMpxApp = _chunk5PICNI6Rjs.isMpx.call(void 0, this.appType);
386
386
  if (shouldRewriteCssImports) {
387
- _chunkKHBSYJ76js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
387
+ _chunk5PICNI6Rjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
388
388
  pkgDir: weappTailwindcssPackageDir,
389
389
  enabled: true,
390
390
  appType: this.appType
391
391
  });
392
- _chunkKHBSYJ76js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
392
+ _chunk5PICNI6Rjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
393
393
  }
394
394
  if (disabledOptions.plugin) {
395
395
  return;
396
396
  }
397
- const patchRecorderState = _chunkZQ7ET56Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
397
+ const patchRecorderState = _chunkEHI5UUJ2js.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
398
398
  source: "runtime",
399
399
  cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
400
400
  });
@@ -405,12 +405,12 @@ var UnifiedWebpackPluginV5 = class {
405
405
  onPatchCompleted: patchRecorderState.onPatchCompleted
406
406
  };
407
407
  const refreshRuntimeState = async (force) => {
408
- await _chunkMVOIVNKLjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
408
+ await _chunkDUNUSQPWjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
409
409
  };
410
410
  async function getClassSetInLoader() {
411
411
  await refreshRuntimeState(true);
412
412
  await runtimeState.patchPromise;
413
- await _chunkMVOIVNKLjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
413
+ await _chunkDUNUSQPWjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
414
414
  }
415
415
  onLoad();
416
416
  setupWebpackV5Loaders({
@@ -3,7 +3,7 @@
3
3
  var _chunkVPHA77FHjs = require('./chunk-VPHA77FH.js');
4
4
 
5
5
 
6
- var _chunkMVOIVNKLjs = require('./chunk-MVOIVNKL.js');
6
+ var _chunkDUNUSQPWjs = require('./chunk-DUNUSQPW.js');
7
7
 
8
8
  // src/shared/mpx.ts
9
9
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
@@ -154,8 +154,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
154
154
  if (!options.enabled) {
155
155
  return;
156
156
  }
157
- compiler.hooks.normalModuleFactory.tap(_chunkMVOIVNKLjs.pluginName, (factory) => {
158
- factory.hooks.beforeResolve.tap(_chunkMVOIVNKLjs.pluginName, (data) => {
157
+ compiler.hooks.normalModuleFactory.tap(_chunkDUNUSQPWjs.pluginName, (factory) => {
158
+ factory.hooks.beforeResolve.tap(_chunkDUNUSQPWjs.pluginName, (data) => {
159
159
  rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
160
160
  });
161
161
  });
@@ -9,7 +9,7 @@ import {
9
9
  isMpx,
10
10
  patchMpxLoaderResolve,
11
11
  setupMpxTailwindcssRedirect
12
- } from "./chunk-XI2H73CF.mjs";
12
+ } from "./chunk-DCYV3N3T.mjs";
13
13
  import {
14
14
  pushConcurrentTaskFactories,
15
15
  resolveDisabledOptions,
@@ -22,14 +22,14 @@ import {
22
22
  } from "./chunk-RRHPTTCP.mjs";
23
23
  import {
24
24
  setupPatchRecorder
25
- } from "./chunk-QAEALIIZ.mjs";
25
+ } from "./chunk-SDVCC3VG.mjs";
26
26
  import {
27
27
  collectRuntimeClassSet,
28
28
  createDebug,
29
29
  getCompilerContext,
30
30
  pluginName,
31
31
  refreshTailwindRuntimeState
32
- } from "./chunk-3IXWQT3G.mjs";
32
+ } from "./chunk-2SD5C6P5.mjs";
33
33
  import {
34
34
  getGroupedEntries
35
35
  } from "./chunk-OOHJLO5M.mjs";
@@ -12,7 +12,7 @@ var _chunkVPHA77FHjs = require('./chunk-VPHA77FH.js');
12
12
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
13
13
 
14
14
 
15
- var _chunkZQ7ET56Gjs = require('./chunk-ZQ7ET56G.js');
15
+ var _chunkEHI5UUJ2js = require('./chunk-EHI5UUJ2.js');
16
16
 
17
17
 
18
18
 
@@ -23,7 +23,7 @@ var _chunkZQ7ET56Gjs = require('./chunk-ZQ7ET56G.js');
23
23
 
24
24
 
25
25
 
26
- var _chunkMVOIVNKLjs = require('./chunk-MVOIVNKL.js');
26
+ var _chunkDUNUSQPWjs = require('./chunk-DUNUSQPW.js');
27
27
 
28
28
 
29
29
 
@@ -54,7 +54,7 @@ function updateStaticAttribute(ms, prop) {
54
54
  const start = prop.value.loc.start.offset + 1;
55
55
  const end = prop.value.loc.end.offset - 1;
56
56
  if (start < end) {
57
- ms.update(start, end, _chunkMVOIVNKLjs.replaceWxml.call(void 0, prop.value.content));
57
+ ms.update(start, end, _chunkDUNUSQPWjs.replaceWxml.call(void 0, prop.value.content));
58
58
  }
59
59
  }
60
60
  function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
@@ -66,7 +66,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
66
66
  if (start >= end) {
67
67
  return;
68
68
  }
69
- const generated = _chunkMVOIVNKLjs.generateCode.call(void 0, prop.exp.content, {
69
+ const generated = _chunkDUNUSQPWjs.generateCode.call(void 0, prop.exp.content, {
70
70
  jsHandler,
71
71
  runtimeSet,
72
72
  wrapExpression: true
@@ -95,7 +95,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
95
95
  return;
96
96
  }
97
97
  const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
98
- const matchCustomAttribute = _chunkMVOIVNKLjs.createAttributeMatcher.call(void 0, customAttributesEntities);
98
+ const matchCustomAttribute = _chunkDUNUSQPWjs.createAttributeMatcher.call(void 0, customAttributesEntities);
99
99
  const ms = new (0, _magicstring2.default)(code);
100
100
  const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
101
101
  if (errors.length === 0) {
@@ -677,7 +677,7 @@ function createRewriteCssImportsPlugins(options) {
677
677
  const { appType, weappTailwindcssDirPosix: weappTailwindcssDirPosix2 } = options;
678
678
  return [
679
679
  {
680
- name: `${_chunkMVOIVNKLjs.vitePluginName}:rewrite-css-imports`,
680
+ name: `${_chunkDUNUSQPWjs.vitePluginName}:rewrite-css-imports`,
681
681
  enforce: "pre",
682
682
  resolveId: {
683
683
  order: "pre",
@@ -719,12 +719,12 @@ function createRewriteCssImportsPlugins(options) {
719
719
  }
720
720
 
721
721
  // src/bundlers/vite/index.ts
722
- var debug = _chunkMVOIVNKLjs.createDebug.call(void 0, );
722
+ var debug = _chunkDUNUSQPWjs.createDebug.call(void 0, );
723
723
  var weappTailwindcssPackageDir = _chunkVPHA77FHjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
724
724
  var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
725
725
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
726
726
  const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
727
- const opts = _chunkMVOIVNKLjs.getCompilerContext.call(void 0, options);
727
+ const opts = _chunkDUNUSQPWjs.getCompilerContext.call(void 0, options);
728
728
  const {
729
729
  disabled,
730
730
  customAttributes,
@@ -749,8 +749,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
749
749
  if (disabledOptions.plugin) {
750
750
  return rewritePlugins.length ? rewritePlugins : void 0;
751
751
  }
752
- const customAttributesEntities = _chunkMVOIVNKLjs.toCustomAttributesEntities.call(void 0, customAttributes);
753
- const patchRecorderState = _chunkZQ7ET56Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
752
+ const customAttributesEntities = _chunkDUNUSQPWjs.toCustomAttributesEntities.call(void 0, customAttributes);
753
+ const patchRecorderState = _chunkEHI5UUJ2js.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
754
754
  source: "runtime",
755
755
  cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
756
756
  });
@@ -764,7 +764,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
764
764
  let runtimeSetPromise;
765
765
  let resolvedConfig;
766
766
  async function refreshRuntimeState(force) {
767
- const refreshed = await _chunkMVOIVNKLjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
767
+ const refreshed = await _chunkDUNUSQPWjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
768
768
  if (refreshed) {
769
769
  runtimeSet = void 0;
770
770
  runtimeSetPromise = void 0;
@@ -777,7 +777,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
777
777
  return runtimeSet;
778
778
  }
779
779
  if (force || !runtimeSetPromise) {
780
- const task2 = _chunkMVOIVNKLjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
780
+ const task2 = _chunkDUNUSQPWjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
781
781
  force: force || !runtimeSet,
782
782
  skipRefresh: force
783
783
  });
@@ -812,7 +812,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
812
812
  const plugins = [
813
813
  ...rewritePlugins,
814
814
  {
815
- name: `${_chunkMVOIVNKLjs.vitePluginName}:post`,
815
+ name: `${_chunkDUNUSQPWjs.vitePluginName}:post`,
816
816
  enforce: "post",
817
817
  configResolved(config) {
818
818
  resolvedConfig = config;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-F2CKKG6Q.mjs";
4
4
  import {
5
5
  pluginName
6
- } from "./chunk-3IXWQT3G.mjs";
6
+ } from "./chunk-2SD5C6P5.mjs";
7
7
 
8
8
  // src/shared/mpx.ts
9
9
  import path2 from "path";
@@ -192,7 +192,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
192
192
  // package.json
193
193
  var package_default = {
194
194
  name: "weapp-tailwindcss",
195
- version: "4.9.4",
195
+ version: "4.9.5",
196
196
  description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
197
197
  author: "ice breaker <1324318532@qq.com>",
198
198
  license: "MIT",
@@ -363,6 +363,7 @@ var package_default = {
363
363
  bench: "vitest bench --config ./vitest.config.ts",
364
364
  "bench:js-handlers": "tsx scripts/js-bench.ts",
365
365
  "bench:js-diff": "tsx scripts/js-bench-diff.ts",
366
+ tsd: "tsd",
366
367
  clean: "tsx scripts/clean.ts",
367
368
  "get-decl": "tsx scripts/get-decl.ts",
368
369
  "ls:pack": "npm pack --dry-run",
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkMVOIVNKLjs = require('./chunk-MVOIVNKL.js');
4
+ var _chunkDUNUSQPWjs = require('./chunk-DUNUSQPW.js');
5
5
 
6
6
 
7
7
  var _chunk4RUFPPI6js = require('./chunk-4RUFPPI6.js');
8
8
 
9
9
  // src/tailwindcss/recorder.ts
10
10
  function setupPatchRecorder(patcher, baseDir, options) {
11
- const recorder = _chunkMVOIVNKLjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
11
+ const recorder = _chunkDUNUSQPWjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
12
12
  if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
13
13
  const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
14
14
  _chunk4RUFPPI6js.logger.info("%s%s", prefix, recorder.message);
@@ -16,7 +16,7 @@ function setupPatchRecorder(patcher, baseDir, options) {
16
16
  const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
17
17
  await recorder.onPatched();
18
18
  } : void 0;
19
- const patchPromise = patcher ? _chunkMVOIVNKLjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
19
+ const patchPromise = patcher ? _chunkDUNUSQPWjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
20
20
  return {
21
21
  recorder,
22
22
  patchPromise,
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-RRHPTTCP.mjs";
4
4
  import {
5
5
  setupPatchRecorder
6
- } from "./chunk-QAEALIIZ.mjs";
6
+ } from "./chunk-SDVCC3VG.mjs";
7
7
  import {
8
8
  collectRuntimeClassSet,
9
9
  createDebug,
10
10
  getCompilerContext,
11
11
  refreshTailwindRuntimeState
12
- } from "./chunk-3IXWQT3G.mjs";
12
+ } from "./chunk-2SD5C6P5.mjs";
13
13
 
14
14
  // src/bundlers/gulp/index.ts
15
15
  import { Buffer } from "buffer";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPatchTargetRecorder,
3
3
  createTailwindPatchPromise
4
- } from "./chunk-3IXWQT3G.mjs";
4
+ } from "./chunk-2SD5C6P5.mjs";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-7D27E7TU.mjs";
@@ -3,13 +3,13 @@
3
3
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
4
4
 
5
5
 
6
- var _chunkZQ7ET56Gjs = require('./chunk-ZQ7ET56G.js');
6
+ var _chunkEHI5UUJ2js = require('./chunk-EHI5UUJ2.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _chunkMVOIVNKLjs = require('./chunk-MVOIVNKL.js');
12
+ var _chunkDUNUSQPWjs = require('./chunk-DUNUSQPW.js');
13
13
 
14
14
  // src/bundlers/gulp/index.ts
15
15
  var _buffer = require('buffer');
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
17
17
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
18
18
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
19
19
  var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
20
- var debug = _chunkMVOIVNKLjs.createDebug.call(void 0, );
20
+ var debug = _chunkDUNUSQPWjs.createDebug.call(void 0, );
21
21
  var Transform = _stream2.default.Transform;
22
22
  function createPlugins(options = {}) {
23
- const opts = _chunkMVOIVNKLjs.getCompilerContext.call(void 0, options);
23
+ const opts = _chunkDUNUSQPWjs.getCompilerContext.call(void 0, options);
24
24
  const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
25
- const patchRecorderState = _chunkZQ7ET56Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
25
+ const patchRecorderState = _chunkEHI5UUJ2js.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
26
26
  source: "runtime",
27
27
  cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
28
28
  });
@@ -36,7 +36,7 @@ function createPlugins(options = {}) {
36
36
  const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
37
37
  let runtimeSetInitialized = false;
38
38
  async function refreshRuntimeState(force) {
39
- await _chunkMVOIVNKLjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
39
+ await _chunkDUNUSQPWjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
40
40
  }
41
41
  async function refreshRuntimeSet(force = false) {
42
42
  await refreshRuntimeState(force);
@@ -44,7 +44,7 @@ function createPlugins(options = {}) {
44
44
  if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
45
45
  return runtimeSet;
46
46
  }
47
- runtimeSet = await _chunkMVOIVNKLjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
47
+ runtimeSet = await _chunkDUNUSQPWjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
48
48
  runtimeSetInitialized = true;
49
49
  return runtimeSet;
50
50
  }
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkMVOIVNKLjs = require('./chunk-MVOIVNKL.js');
6
+ var _chunkDUNUSQPWjs = require('./chunk-DUNUSQPW.js');
7
7
 
8
8
 
9
9
 
@@ -404,9 +404,9 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
404
404
  try {
405
405
  const patcher = createWorkspacePatcher(dir);
406
406
  if (options.clearCache) {
407
- await _chunkMVOIVNKLjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
407
+ await _chunkDUNUSQPWjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
408
408
  }
409
- const recorder = _chunkMVOIVNKLjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
409
+ const recorder = _chunkDUNUSQPWjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
410
410
  source: "cli",
411
411
  cwd: dir,
412
412
  recordTarget: options.recordTarget !== false,
@@ -415,7 +415,7 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
415
415
  if (_optionalChain([recorder, 'optionalAccess', _12 => _12.message])) {
416
416
  _chunk4RUFPPI6js.logger.info("[workspace] %s %s", displayName, recorder.message);
417
417
  }
418
- _chunkMVOIVNKLjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
418
+ _chunkDUNUSQPWjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
419
419
  await patcher.patch();
420
420
  if (_optionalChain([recorder, 'optionalAccess', _13 => _13.onPatched])) {
421
421
  await recorder.onPatched();
@@ -546,9 +546,9 @@ var mountOptions = {
546
546
  }
547
547
  const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
548
548
  if (shouldClearCache) {
549
- await _chunkMVOIVNKLjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
549
+ await _chunkDUNUSQPWjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
550
550
  }
551
- const recorder = _chunkMVOIVNKLjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
551
+ const recorder = _chunkDUNUSQPWjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
552
552
  source: "cli",
553
553
  cwd: ctx.cwd,
554
554
  recordTarget: shouldRecordTarget,
@@ -557,7 +557,7 @@ var mountOptions = {
557
557
  if (_optionalChain([recorder, 'optionalAccess', _15 => _15.message])) {
558
558
  _chunk4RUFPPI6js.logger.info(recorder.message);
559
559
  }
560
- _chunkMVOIVNKLjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
560
+ _chunkDUNUSQPWjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
561
561
  await patcher.patch();
562
562
  if (_optionalChain([recorder, 'optionalAccess', _16 => _16.onPatched])) {
563
563
  const recordPath = await recorder.onPatched();
@@ -705,9 +705,9 @@ async function generateVscodeIntellisenseEntry(options) {
705
705
 
706
706
  // src/cli.ts
707
707
  _process2.default.title = "node (weapp-tailwindcss)";
708
- if (_semver2.default.lt(_process2.default.versions.node, _chunkMVOIVNKLjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
708
+ if (_semver2.default.lt(_process2.default.versions.node, _chunkDUNUSQPWjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
709
709
  _chunk4RUFPPI6js.logger.warn(
710
- `You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkMVOIVNKLjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
710
+ `You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkDUNUSQPWjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
711
711
  );
712
712
  }
713
713
  var cli = _tailwindcsspatch.createTailwindcssPatchCli.call(void 0, {
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  clearTailwindcssPatcherCache,
4
4
  createPatchTargetRecorder,
5
5
  logTailwindcssTarget
6
- } from "./chunk-3IXWQT3G.mjs";
6
+ } from "./chunk-2SD5C6P5.mjs";
7
7
  import {
8
8
  findWorkspaceRoot,
9
9
  logger
package/dist/core.d.mts CHANGED
@@ -1,5 +1,6 @@
1
- import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.mjs';
1
+ import { ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.mjs';
2
2
  import * as postcss from 'postcss';
3
+ import { U as UserDefinedOptions } from './index-D4tYbWC6.mjs';
3
4
  import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
4
5
  import '@babel/parser';
5
6
  import 'magic-string';
package/dist/core.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.js';
1
+ import { ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.js';
2
2
  import * as postcss from 'postcss';
3
+ import { U as UserDefinedOptions } from './index-D4tYbWC6.js';
3
4
  import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
4
5
  import '@babel/parser';
5
6
  import 'magic-string';
package/dist/core.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkZQ7ET56Gjs = require('./chunk-ZQ7ET56G.js');
3
+ var _chunkEHI5UUJ2js = require('./chunk-EHI5UUJ2.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkMVOIVNKLjs = require('./chunk-MVOIVNKL.js');
8
+ var _chunkDUNUSQPWjs = require('./chunk-DUNUSQPW.js');
9
9
  require('./chunk-4RUFPPI6.js');
10
10
  require('./chunk-FYYBY3VK.js');
11
11
  require('./chunk-DYLQ6UOI.js');
@@ -15,9 +15,9 @@ require('./chunk-Y6F6NBA7.js');
15
15
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
16
16
  var _shared = require('@weapp-tailwindcss/shared');
17
17
  function createContext(options = {}) {
18
- const opts = _chunkMVOIVNKLjs.getCompilerContext.call(void 0, options);
18
+ const opts = _chunkDUNUSQPWjs.getCompilerContext.call(void 0, options);
19
19
  const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
20
- const patchRecorderState = _chunkZQ7ET56Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
20
+ const patchRecorderState = _chunkEHI5UUJ2js.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
21
21
  source: "runtime",
22
22
  cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
23
23
  });
@@ -29,7 +29,7 @@ function createContext(options = {}) {
29
29
  onPatchCompleted: patchRecorderState.onPatchCompleted
30
30
  };
31
31
  async function refreshRuntimeState(force) {
32
- await _chunkMVOIVNKLjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
32
+ await _chunkDUNUSQPWjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
33
33
  }
34
34
  async function transformWxss(rawCss, options2) {
35
35
  await runtimeState.patchPromise;
@@ -38,7 +38,7 @@ function createContext(options = {}) {
38
38
  }));
39
39
  await refreshRuntimeState(true);
40
40
  await runtimeState.patchPromise;
41
- runtimeSet = await _chunkMVOIVNKLjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
41
+ runtimeSet = await _chunkDUNUSQPWjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
42
42
  return result;
43
43
  }
44
44
  async function transformJs(rawJs, options2 = {}) {
@@ -48,7 +48,7 @@ function createContext(options = {}) {
48
48
  } else {
49
49
  await refreshRuntimeState(true);
50
50
  await runtimeState.patchPromise;
51
- runtimeSet = await _chunkMVOIVNKLjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
51
+ runtimeSet = await _chunkDUNUSQPWjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
52
52
  }
53
53
  return await jsHandler(rawJs, runtimeSet, options2);
54
54
  }
@@ -57,7 +57,7 @@ function createContext(options = {}) {
57
57
  if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
58
58
  await refreshRuntimeState(true);
59
59
  await runtimeState.patchPromise;
60
- runtimeSet = await _chunkMVOIVNKLjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
60
+ runtimeSet = await _chunkDUNUSQPWjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
61
61
  }
62
62
  return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
63
63
  runtimeSet