weapp-tailwindcss 4.8.14 → 4.8.15

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.
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-RRHPTTCP.mjs";
4
4
  import {
5
5
  setupPatchRecorder
6
- } from "./chunk-7UAU27KZ.mjs";
6
+ } from "./chunk-FQX7YIN5.mjs";
7
7
  import {
8
8
  collectRuntimeClassSet,
9
9
  createDebug,
10
10
  getCompilerContext,
11
11
  refreshTailwindRuntimeState
12
- } from "./chunk-ZC5JYOAR.mjs";
12
+ } from "./chunk-QYYQDG6A.mjs";
13
13
 
14
14
  // src/bundlers/gulp/index.ts
15
15
  import { Buffer } from "buffer";
@@ -9,7 +9,7 @@ import {
9
9
  isMpx,
10
10
  patchMpxLoaderResolve,
11
11
  setupMpxTailwindcssRedirect
12
- } from "./chunk-FSI2IWUY.mjs";
12
+ } from "./chunk-XRYCPSQC.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-7UAU27KZ.mjs";
25
+ } from "./chunk-FQX7YIN5.mjs";
26
26
  import {
27
27
  collectRuntimeClassSet,
28
28
  createDebug,
29
29
  getCompilerContext,
30
30
  pluginName,
31
31
  refreshTailwindRuntimeState
32
- } from "./chunk-ZC5JYOAR.mjs";
32
+ } from "./chunk-QYYQDG6A.mjs";
33
33
  import {
34
34
  getGroupedEntries
35
35
  } from "./chunk-ZNKIYZRQ.mjs";
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
187
187
  // package.json
188
188
  var package_default = {
189
189
  name: "weapp-tailwindcss",
190
- version: "4.8.14",
190
+ version: "4.8.15",
191
191
  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!",
192
192
  author: "ice breaker <1324318532@qq.com>",
193
193
  license: "MIT",
@@ -3,7 +3,7 @@
3
3
  var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
4
4
 
5
5
 
6
- var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
6
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.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(_chunk63LJ4WHFjs.pluginName, (factory) => {
158
- factory.hooks.beforeResolve.tap(_chunk63LJ4WHFjs.pluginName, (data) => {
157
+ compiler.hooks.normalModuleFactory.tap(_chunk7UBHTADVjs.pluginName, (factory) => {
158
+ factory.hooks.beforeResolve.tap(_chunk7UBHTADVjs.pluginName, (data) => {
159
159
  rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
160
160
  });
161
161
  });
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPatchTargetRecorder,
3
3
  createTailwindPatchPromise
4
- } from "./chunk-ZC5JYOAR.mjs";
4
+ } from "./chunk-QYYQDG6A.mjs";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-3VIPMWAG.mjs";
@@ -3,13 +3,13 @@
3
3
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
4
4
 
5
5
 
6
- var _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
6
+ var _chunkI7VIMPUBjs = require('./chunk-I7VIMPUB.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
12
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.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 = _chunk63LJ4WHFjs.createDebug.call(void 0, );
20
+ var debug = _chunk7UBHTADVjs.createDebug.call(void 0, );
21
21
  var Transform = _stream2.default.Transform;
22
22
  function createPlugins(options = {}) {
23
- const opts = _chunk63LJ4WHFjs.getCompilerContext.call(void 0, options);
23
+ const opts = _chunk7UBHTADVjs.getCompilerContext.call(void 0, options);
24
24
  const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
25
- const patchRecorderState = _chunk477TX4LMjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
25
+ const patchRecorderState = _chunkI7VIMPUBjs.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 _chunk63LJ4WHFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
39
+ await _chunk7UBHTADVjs.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 _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
47
+ runtimeSet = await _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
48
48
  runtimeSetInitialized = true;
49
49
  return runtimeSet;
50
50
  }
@@ -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 _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
4
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.js');
5
5
 
6
6
 
7
7
  var _chunkJ4MI4EJOjs = require('./chunk-J4MI4EJO.js');
8
8
 
9
9
  // src/tailwindcss/recorder.ts
10
10
  function setupPatchRecorder(patcher, baseDir, options) {
11
- const recorder = _chunk63LJ4WHFjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
11
+ const recorder = _chunk7UBHTADVjs.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
  _chunkJ4MI4EJOjs.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 ? _chunk63LJ4WHFjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
19
+ const patchPromise = patcher ? _chunk7UBHTADVjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
20
20
  return {
21
21
  recorder,
22
22
  patchPromise,
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-RRHPTTCP.mjs";
13
13
  import {
14
14
  setupPatchRecorder
15
- } from "./chunk-7UAU27KZ.mjs";
15
+ } from "./chunk-FQX7YIN5.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-ZC5JYOAR.mjs";
26
+ } from "./chunk-QYYQDG6A.mjs";
27
27
  import {
28
28
  getGroupedEntries
29
29
  } from "./chunk-ZNKIYZRQ.mjs";
@@ -158,7 +158,8 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
158
158
  // src/bundlers/vite/query.ts
159
159
  function parseVueRequest(id) {
160
160
  const [filename, rawQuery] = id.split(`?`, 2);
161
- const query = Object.fromEntries(new URLSearchParams(rawQuery));
161
+ const searchParams = new URLSearchParams(rawQuery);
162
+ const query = Object.fromEntries(searchParams);
162
163
  if (query.vue != null) {
163
164
  query.vue = true;
164
165
  }
@@ -174,6 +175,11 @@ function parseVueRequest(id) {
174
175
  if (query.scoped != null) {
175
176
  query.scoped = true;
176
177
  }
178
+ const langTypeMatch = [...searchParams.keys()].find((key) => key.startsWith("lang."));
179
+ const langType = query.lang || (langTypeMatch ? langTypeMatch.slice("lang.".length) : void 0);
180
+ if (langType) {
181
+ query.lang = langType;
182
+ }
177
183
  return {
178
184
  filename,
179
185
  query
@@ -219,6 +225,13 @@ async function formatPostcssSourceMap(rawMap, file) {
219
225
  }
220
226
 
221
227
  // src/uni-app-x/vite.ts
228
+ var preprocessorLangs = /* @__PURE__ */ new Set(["scss", "sass", "less", "styl", "stylus"]);
229
+ function isPreprocessorRequest(id, lang) {
230
+ if (lang && preprocessorLangs.has(lang)) {
231
+ return true;
232
+ }
233
+ return /\.(?:scss|sass|less|styl|stylus)(?:\?|$)/.test(id);
234
+ }
222
235
  function createUniAppXPlugins(options) {
223
236
  const {
224
237
  appType,
@@ -237,6 +250,10 @@ function createUniAppXPlugins(options) {
237
250
  async transform(code, id) {
238
251
  await runtimeState.patchPromise;
239
252
  const { query } = parseVueRequest(id);
253
+ const lang = query.lang;
254
+ if (enforce === "pre" && isPreprocessorRequest(id, lang)) {
255
+ return;
256
+ }
240
257
  if (isCSSRequest(id) || query.vue && query.type === "style") {
241
258
  const postcssResult = await styleHandler(code, {
242
259
  isMainChunk: mainCssChunkMatcher(id, appType),
@@ -12,7 +12,7 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
12
12
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
13
13
 
14
14
 
15
- var _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
15
+ var _chunkI7VIMPUBjs = require('./chunk-I7VIMPUB.js');
16
16
 
17
17
 
18
18
 
@@ -23,7 +23,7 @@ var _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
23
23
 
24
24
 
25
25
 
26
- var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
26
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.js');
27
27
 
28
28
 
29
29
  var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
@@ -55,7 +55,7 @@ function updateStaticAttribute(ms, prop) {
55
55
  const start = prop.value.loc.start.offset + 1;
56
56
  const end = prop.value.loc.end.offset - 1;
57
57
  if (start < end) {
58
- ms.update(start, end, _chunk63LJ4WHFjs.replaceWxml.call(void 0, prop.value.content));
58
+ ms.update(start, end, _chunk7UBHTADVjs.replaceWxml.call(void 0, prop.value.content));
59
59
  }
60
60
  }
61
61
  function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
@@ -67,7 +67,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
67
67
  if (start >= end) {
68
68
  return;
69
69
  }
70
- const generated = _chunk63LJ4WHFjs.generateCode.call(void 0, prop.exp.content, {
70
+ const generated = _chunk7UBHTADVjs.generateCode.call(void 0, prop.exp.content, {
71
71
  jsHandler,
72
72
  runtimeSet,
73
73
  wrapExpression: true
@@ -96,7 +96,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
96
96
  return;
97
97
  }
98
98
  const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
99
- const matchCustomAttribute = _chunk63LJ4WHFjs.createAttributeMatcher.call(void 0, customAttributesEntities);
99
+ const matchCustomAttribute = _chunk7UBHTADVjs.createAttributeMatcher.call(void 0, customAttributesEntities);
100
100
  const ms = new (0, _magicstring2.default)(code);
101
101
  const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
102
102
  if (errors.length === 0) {
@@ -158,7 +158,8 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
158
158
  // src/bundlers/vite/query.ts
159
159
  function parseVueRequest(id) {
160
160
  const [filename, rawQuery] = id.split(`?`, 2);
161
- const query = Object.fromEntries(new URLSearchParams(rawQuery));
161
+ const searchParams = new URLSearchParams(rawQuery);
162
+ const query = Object.fromEntries(searchParams);
162
163
  if (query.vue != null) {
163
164
  query.vue = true;
164
165
  }
@@ -174,6 +175,11 @@ function parseVueRequest(id) {
174
175
  if (query.scoped != null) {
175
176
  query.scoped = true;
176
177
  }
178
+ const langTypeMatch = [...searchParams.keys()].find((key) => key.startsWith("lang."));
179
+ const langType = query.lang || (langTypeMatch ? langTypeMatch.slice("lang.".length) : void 0);
180
+ if (langType) {
181
+ query.lang = langType;
182
+ }
177
183
  return {
178
184
  filename,
179
185
  query
@@ -219,6 +225,13 @@ async function formatPostcssSourceMap(rawMap, file) {
219
225
  }
220
226
 
221
227
  // src/uni-app-x/vite.ts
228
+ var preprocessorLangs = /* @__PURE__ */ new Set(["scss", "sass", "less", "styl", "stylus"]);
229
+ function isPreprocessorRequest(id, lang) {
230
+ if (lang && preprocessorLangs.has(lang)) {
231
+ return true;
232
+ }
233
+ return /\.(?:scss|sass|less|styl|stylus)(?:\?|$)/.test(id);
234
+ }
222
235
  function createUniAppXPlugins(options) {
223
236
  const {
224
237
  appType,
@@ -237,6 +250,10 @@ function createUniAppXPlugins(options) {
237
250
  async transform(code, id) {
238
251
  await runtimeState.patchPromise;
239
252
  const { query } = parseVueRequest(id);
253
+ const lang = query.lang;
254
+ if (enforce === "pre" && isPreprocessorRequest(id, lang)) {
255
+ return;
256
+ }
240
257
  if (isCSSRequest(id) || query.vue && query.type === "style") {
241
258
  const postcssResult = await styleHandler(code, {
242
259
  isMainChunk: mainCssChunkMatcher(id, appType),
@@ -362,7 +379,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
362
379
  }
363
380
 
364
381
  // src/bundlers/vite/index.ts
365
- var debug = _chunk63LJ4WHFjs.createDebug.call(void 0, );
382
+ var debug = _chunk7UBHTADVjs.createDebug.call(void 0, );
366
383
  var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
367
384
  var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
368
385
  function joinPosixPath(base, subpath) {
@@ -445,7 +462,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
445
462
  }
446
463
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
447
464
  const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
448
- const opts = _chunk63LJ4WHFjs.getCompilerContext.call(void 0, options);
465
+ const opts = _chunk7UBHTADVjs.getCompilerContext.call(void 0, options);
449
466
  const {
450
467
  disabled,
451
468
  customAttributes,
@@ -469,7 +486,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
469
486
  const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
470
487
  const rewritePlugins = !shouldRewriteCssImports ? [] : [
471
488
  {
472
- name: `${_chunk63LJ4WHFjs.vitePluginName}:rewrite-css-imports`,
489
+ name: `${_chunk7UBHTADVjs.vitePluginName}:rewrite-css-imports`,
473
490
  enforce: "pre",
474
491
  resolveId: {
475
492
  order: "pre",
@@ -511,8 +528,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
511
528
  if (disabledOptions.plugin) {
512
529
  return rewritePlugins.length ? rewritePlugins : void 0;
513
530
  }
514
- const customAttributesEntities = _chunk63LJ4WHFjs.toCustomAttributesEntities.call(void 0, customAttributes);
515
- const patchRecorderState = _chunk477TX4LMjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
531
+ const customAttributesEntities = _chunk7UBHTADVjs.toCustomAttributesEntities.call(void 0, customAttributes);
532
+ const patchRecorderState = _chunkI7VIMPUBjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
516
533
  source: "runtime",
517
534
  cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
518
535
  });
@@ -526,7 +543,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
526
543
  let runtimeSetPromise;
527
544
  let resolvedConfig;
528
545
  async function refreshRuntimeState(force) {
529
- const refreshed = await _chunk63LJ4WHFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
546
+ const refreshed = await _chunk7UBHTADVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
530
547
  if (refreshed) {
531
548
  runtimeSet = void 0;
532
549
  runtimeSetPromise = void 0;
@@ -539,7 +556,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
539
556
  return runtimeSet;
540
557
  }
541
558
  if (force || !runtimeSetPromise) {
542
- const task2 = _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
559
+ const task2 = _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
543
560
  force: force || !runtimeSet,
544
561
  skipRefresh: force
545
562
  });
@@ -571,7 +588,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
571
588
  const plugins = [
572
589
  ...rewritePlugins,
573
590
  {
574
- name: `${_chunk63LJ4WHFjs.vitePluginName}:post`,
591
+ name: `${_chunk7UBHTADVjs.vitePluginName}:post`,
575
592
  enforce: "post",
576
593
  configResolved(config) {
577
594
  resolvedConfig = config;
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
187
187
  // package.json
188
188
  var package_default = {
189
189
  name: "weapp-tailwindcss",
190
- version: "4.8.14",
190
+ version: "4.8.15",
191
191
  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!",
192
192
  author: "ice breaker <1324318532@qq.com>",
193
193
  license: "MIT",
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- var _chunk6VSFN3NAjs = require('./chunk-6VSFN3NA.js');
12
+ var _chunkDGL3SP2Hjs = require('./chunk-DGL3SP2H.js');
13
13
 
14
14
 
15
15
 
@@ -22,14 +22,14 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
22
22
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
23
23
 
24
24
 
25
- var _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
25
+ var _chunkI7VIMPUBjs = require('./chunk-I7VIMPUB.js');
26
26
 
27
27
 
28
28
 
29
29
 
30
30
 
31
31
 
32
- var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
32
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.js');
33
33
 
34
34
 
35
35
  var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
@@ -38,11 +38,11 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
38
38
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
39
39
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
40
40
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
41
- var debug = _chunk63LJ4WHFjs.createDebug.call(void 0, );
41
+ var debug = _chunk7UBHTADVjs.createDebug.call(void 0, );
42
42
  var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
43
43
  var UnifiedWebpackPluginV5 = class {
44
44
  constructor(options = {}) {
45
- this.options = _chunk63LJ4WHFjs.getCompilerContext.call(void 0, options);
45
+ this.options = _chunk7UBHTADVjs.getCompilerContext.call(void 0, options);
46
46
  this.appType = this.options.appType;
47
47
  }
48
48
  apply(compiler) {
@@ -66,19 +66,19 @@ var UnifiedWebpackPluginV5 = class {
66
66
  const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
67
67
  const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
68
68
  const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
69
- const isMpxApp = _chunk6VSFN3NAjs.isMpx.call(void 0, this.appType);
69
+ const isMpxApp = _chunkDGL3SP2Hjs.isMpx.call(void 0, this.appType);
70
70
  if (shouldRewriteCssImports) {
71
- _chunk6VSFN3NAjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
71
+ _chunkDGL3SP2Hjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
72
72
  pkgDir: weappTailwindcssPackageDir,
73
73
  enabled: true,
74
74
  appType: this.appType
75
75
  });
76
- _chunk6VSFN3NAjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
76
+ _chunkDGL3SP2Hjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
77
77
  }
78
78
  if (disabledOptions.plugin) {
79
79
  return;
80
80
  }
81
- const patchRecorderState = _chunk477TX4LMjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
81
+ const patchRecorderState = _chunkI7VIMPUBjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
82
82
  source: "runtime",
83
83
  cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
84
84
  });
@@ -89,14 +89,14 @@ var UnifiedWebpackPluginV5 = class {
89
89
  onPatchCompleted: patchRecorderState.onPatchCompleted
90
90
  };
91
91
  const refreshRuntimeState = async (force) => {
92
- await _chunk63LJ4WHFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
92
+ await _chunk7UBHTADVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
93
93
  };
94
94
  const { Compilation, sources, NormalModule } = compiler.webpack;
95
95
  const { ConcatSource } = sources;
96
96
  async function getClassSetInLoader() {
97
97
  await refreshRuntimeState(true);
98
98
  await runtimeState.patchPromise;
99
- await _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
99
+ await _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
100
100
  }
101
101
  const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
102
102
  const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
@@ -109,16 +109,16 @@ var UnifiedWebpackPluginV5 = class {
109
109
  const classSetLoaderOptions = {
110
110
  getClassSet: getClassSetInLoader
111
111
  };
112
- const { findRewriteAnchor, findClassSetAnchor } = _chunk6VSFN3NAjs.createLoaderAnchorFinders.call(void 0, this.appType);
112
+ const { findRewriteAnchor, findClassSetAnchor } = _chunkDGL3SP2Hjs.createLoaderAnchorFinders.call(void 0, this.appType);
113
113
  const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
114
114
  rewriteCssImports: runtimeLoaderRewriteOptions
115
115
  } : void 0;
116
116
  onLoad();
117
117
  if (shouldRewriteCssImports && isMpxApp) {
118
- _chunk6VSFN3NAjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
118
+ _chunkDGL3SP2Hjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
119
119
  }
120
120
  if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
121
- _chunk6VSFN3NAjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
121
+ _chunkDGL3SP2Hjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
122
122
  }
123
123
  const createRuntimeClassSetLoaderEntry = () => ({
124
124
  loader: runtimeClassSetLoader,
@@ -137,17 +137,17 @@ var UnifiedWebpackPluginV5 = class {
137
137
  type: null
138
138
  };
139
139
  };
140
- compiler.hooks.compilation.tap(_chunk63LJ4WHFjs.pluginName, (compilation) => {
141
- NormalModule.getCompilationHooks(compilation).loader.tap(_chunk63LJ4WHFjs.pluginName, (_loaderContext, module) => {
140
+ compiler.hooks.compilation.tap(_chunk7UBHTADVjs.pluginName, (compilation) => {
141
+ NormalModule.getCompilationHooks(compilation).loader.tap(_chunk7UBHTADVjs.pluginName, (_loaderContext, module) => {
142
142
  const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
143
143
  if (!hasRuntimeLoader) {
144
144
  return;
145
145
  }
146
- _chunk6VSFN3NAjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
146
+ _chunkDGL3SP2Hjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
147
147
  const loaderEntries = module.loaders || [];
148
148
  let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
149
149
  const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
150
- const isCssModule = _chunk6VSFN3NAjs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
150
+ const isCssModule = _chunkDGL3SP2Hjs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
151
151
  if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
152
152
  debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
153
153
  }
@@ -179,7 +179,7 @@ var UnifiedWebpackPluginV5 = class {
179
179
  rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
180
180
  }
181
181
  }
182
- if (runtimeClassSetLoaderExists && !_chunk6VSFN3NAjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
182
+ if (runtimeClassSetLoaderExists && !_chunkDGL3SP2Hjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
183
183
  const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
184
184
  const anchorIndex = findClassSetAnchor(loaderEntries);
185
185
  if (anchorIndex === -1) {
@@ -192,7 +192,7 @@ var UnifiedWebpackPluginV5 = class {
192
192
  });
193
193
  compilation.hooks.processAssets.tapPromise(
194
194
  {
195
- name: _chunk63LJ4WHFjs.pluginName,
195
+ name: _chunk7UBHTADVjs.pluginName,
196
196
  stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
197
197
  },
198
198
  async (assets) => {
@@ -261,7 +261,7 @@ var UnifiedWebpackPluginV5 = class {
261
261
  const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
262
262
  await refreshRuntimeState(true);
263
263
  await runtimeState.patchPromise;
264
- const runtimeSet = await _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
264
+ const runtimeSet = await _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
265
265
  debug("get runtimeSet, class count: %d", runtimeSet.size);
266
266
  const tasks = [];
267
267
  if (Array.isArray(groupedEntries.html)) {
@@ -298,7 +298,7 @@ var UnifiedWebpackPluginV5 = class {
298
298
  const jsTaskFactories = [];
299
299
  if (Array.isArray(groupedEntries.js)) {
300
300
  for (const [file] of groupedEntries.js) {
301
- const cacheKey = _chunk6VSFN3NAjs.getCacheKey.call(void 0, file);
301
+ const cacheKey = _chunkDGL3SP2Hjs.getCacheKey.call(void 0, file);
302
302
  const asset = compilation.getAsset(file);
303
303
  if (!asset) {
304
304
  continue;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3SKEY32E.mjs";
4
4
  import {
5
5
  pluginName
6
- } from "./chunk-ZC5JYOAR.mjs";
6
+ } from "./chunk-QYYQDG6A.mjs";
7
7
 
8
8
  // src/shared/mpx.ts
9
9
  import path2 from "path";
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
6
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.js');
7
7
 
8
8
 
9
9
 
@@ -334,9 +334,9 @@ async function patchWorkspace(options) {
334
334
  try {
335
335
  const patcher = createWorkspacePatcher(dir);
336
336
  if (options.clearCache) {
337
- await _chunk63LJ4WHFjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
337
+ await _chunk7UBHTADVjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
338
338
  }
339
- const recorder = _chunk63LJ4WHFjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
339
+ const recorder = _chunk7UBHTADVjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
340
340
  source: "cli",
341
341
  cwd: dir,
342
342
  recordTarget: options.recordTarget !== false,
@@ -345,7 +345,7 @@ async function patchWorkspace(options) {
345
345
  if (_optionalChain([recorder, 'optionalAccess', _13 => _13.message])) {
346
346
  _chunkJ4MI4EJOjs.logger.info("[workspace] %s %s", displayName, recorder.message);
347
347
  }
348
- _chunk63LJ4WHFjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
348
+ _chunk7UBHTADVjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
349
349
  await patcher.patch();
350
350
  if (_optionalChain([recorder, 'optionalAccess', _14 => _14.onPatched])) {
351
351
  await recorder.onPatched();
@@ -500,9 +500,9 @@ var mountOptions = {
500
500
  }
501
501
  const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
502
502
  if (shouldClearCache) {
503
- await _chunk63LJ4WHFjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
503
+ await _chunk7UBHTADVjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
504
504
  }
505
- const recorder = _chunk63LJ4WHFjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
505
+ const recorder = _chunk7UBHTADVjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
506
506
  source: "cli",
507
507
  cwd: ctx.cwd,
508
508
  recordTarget: shouldRecordTarget,
@@ -511,7 +511,7 @@ var mountOptions = {
511
511
  if (_optionalChain([recorder, 'optionalAccess', _18 => _18.message])) {
512
512
  _chunkJ4MI4EJOjs.logger.info(recorder.message);
513
513
  }
514
- _chunk63LJ4WHFjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
514
+ _chunk7UBHTADVjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
515
515
  await patcher.patch();
516
516
  if (_optionalChain([recorder, 'optionalAccess', _19 => _19.onPatched])) {
517
517
  const recordPath = await recorder.onPatched();
@@ -659,9 +659,9 @@ async function generateVscodeIntellisenseEntry(options) {
659
659
 
660
660
  // src/cli.ts
661
661
  _process2.default.title = "node (weapp-tailwindcss)";
662
- if (_semver2.default.lt(_process2.default.versions.node, _chunk63LJ4WHFjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
662
+ if (_semver2.default.lt(_process2.default.versions.node, _chunk7UBHTADVjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
663
663
  _chunkJ4MI4EJOjs.logger.warn(
664
- `You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunk63LJ4WHFjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
664
+ `You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunk7UBHTADVjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
665
665
  );
666
666
  }
667
667
  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-ZC5JYOAR.mjs";
6
+ } from "./chunk-QYYQDG6A.mjs";
7
7
  import {
8
8
  findWorkspaceRoot,
9
9
  logger
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 _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
3
+ var _chunkI7VIMPUBjs = require('./chunk-I7VIMPUB.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
8
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.js');
9
9
  require('./chunk-J4MI4EJO.js');
10
10
  require('./chunk-3URI7W6X.js');
11
11
  require('./chunk-UW3WHSZ5.js');
@@ -15,9 +15,9 @@ require('./chunk-MB4BR57E.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 = _chunk63LJ4WHFjs.getCompilerContext.call(void 0, options);
18
+ const opts = _chunk7UBHTADVjs.getCompilerContext.call(void 0, options);
19
19
  const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
20
- const patchRecorderState = _chunk477TX4LMjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
20
+ const patchRecorderState = _chunkI7VIMPUBjs.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 _chunk63LJ4WHFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
32
+ await _chunk7UBHTADVjs.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 _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
41
+ runtimeSet = await _chunk7UBHTADVjs.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 _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
51
+ runtimeSet = await _chunk7UBHTADVjs.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 _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
60
+ runtimeSet = await _chunk7UBHTADVjs.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
package/dist/core.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  setupPatchRecorder
3
- } from "./chunk-7UAU27KZ.mjs";
3
+ } from "./chunk-FQX7YIN5.mjs";
4
4
  import {
5
5
  collectRuntimeClassSet,
6
6
  getCompilerContext,
7
7
  refreshTailwindRuntimeState
8
- } from "./chunk-ZC5JYOAR.mjs";
8
+ } from "./chunk-QYYQDG6A.mjs";
9
9
  import "./chunk-3VIPMWAG.mjs";
10
10
  import "./chunk-QF65JGNW.mjs";
11
11
  import "./chunk-ZNKIYZRQ.mjs";
package/dist/gulp.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkL3AOBWDWjs = require('./chunk-L3AOBWDW.js');
3
+ var _chunkH4BVDT5Qjs = require('./chunk-H4BVDT5Q.js');
4
4
  require('./chunk-LTJQUORK.js');
5
- require('./chunk-477TX4LM.js');
6
- require('./chunk-63LJ4WHF.js');
5
+ require('./chunk-I7VIMPUB.js');
6
+ require('./chunk-7UBHTADV.js');
7
7
  require('./chunk-J4MI4EJO.js');
8
8
  require('./chunk-3URI7W6X.js');
9
9
  require('./chunk-UW3WHSZ5.js');
10
10
  require('./chunk-MB4BR57E.js');
11
11
 
12
12
 
13
- exports.createPlugins = _chunkL3AOBWDWjs.createPlugins;
13
+ exports.createPlugins = _chunkH4BVDT5Qjs.createPlugins;
package/dist/gulp.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createPlugins
3
- } from "./chunk-EKF3ABRO.mjs";
3
+ } from "./chunk-4ZJEFTPC.mjs";
4
4
  import "./chunk-RRHPTTCP.mjs";
5
- import "./chunk-7UAU27KZ.mjs";
6
- import "./chunk-ZC5JYOAR.mjs";
5
+ import "./chunk-FQX7YIN5.mjs";
6
+ import "./chunk-QYYQDG6A.mjs";
7
7
  import "./chunk-3VIPMWAG.mjs";
8
8
  import "./chunk-QF65JGNW.mjs";
9
9
  import "./chunk-ZNKIYZRQ.mjs";
package/dist/index.js CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
 
4
4
 
5
- var _chunk2AWOAQD3js = require('./chunk-2AWOAQD3.js');
6
- require('./chunk-6VSFN3NA.js');
5
+ var _chunkW3CX5DGRjs = require('./chunk-W3CX5DGR.js');
6
+ require('./chunk-DGL3SP2H.js');
7
7
 
8
8
 
9
- var _chunkL3AOBWDWjs = require('./chunk-L3AOBWDW.js');
9
+ var _chunkH4BVDT5Qjs = require('./chunk-H4BVDT5Q.js');
10
10
 
11
11
 
12
- var _chunkML4F4ZPYjs = require('./chunk-ML4F4ZPY.js');
12
+ var _chunkPIVX3SXUjs = require('./chunk-PIVX3SXU.js');
13
13
  require('./chunk-ORSWL3MI.js');
14
14
  require('./chunk-LTJQUORK.js');
15
- require('./chunk-477TX4LM.js');
16
- require('./chunk-63LJ4WHF.js');
15
+ require('./chunk-I7VIMPUB.js');
16
+ require('./chunk-7UBHTADV.js');
17
17
  require('./chunk-J4MI4EJO.js');
18
18
  require('./chunk-3URI7W6X.js');
19
19
  require('./chunk-UW3WHSZ5.js');
@@ -23,4 +23,4 @@ require('./chunk-MB4BR57E.js');
23
23
 
24
24
 
25
25
 
26
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkML4F4ZPYjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunk2AWOAQD3js.UnifiedWebpackPluginV5; exports.createPlugins = _chunkL3AOBWDWjs.createPlugins; exports.weappTailwindcssPackageDir = _chunk2AWOAQD3js.weappTailwindcssPackageDir;
26
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkPIVX3SXUjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkW3CX5DGRjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkH4BVDT5Qjs.createPlugins; exports.weappTailwindcssPackageDir = _chunkW3CX5DGRjs.weappTailwindcssPackageDir;
package/dist/index.mjs CHANGED
@@ -2,18 +2,18 @@ import "./chunk-YAN7TO2B.mjs";
2
2
  import {
3
3
  UnifiedWebpackPluginV5,
4
4
  weappTailwindcssPackageDir
5
- } from "./chunk-HJWY5Y6L.mjs";
6
- import "./chunk-FSI2IWUY.mjs";
5
+ } from "./chunk-7LRI7LJO.mjs";
6
+ import "./chunk-XRYCPSQC.mjs";
7
7
  import {
8
8
  createPlugins
9
- } from "./chunk-EKF3ABRO.mjs";
9
+ } from "./chunk-4ZJEFTPC.mjs";
10
10
  import {
11
11
  UnifiedViteWeappTailwindcssPlugin
12
- } from "./chunk-2HIXWVX2.mjs";
12
+ } from "./chunk-K3XO75VC.mjs";
13
13
  import "./chunk-3SKEY32E.mjs";
14
14
  import "./chunk-RRHPTTCP.mjs";
15
- import "./chunk-7UAU27KZ.mjs";
16
- import "./chunk-ZC5JYOAR.mjs";
15
+ import "./chunk-FQX7YIN5.mjs";
16
+ import "./chunk-QYYQDG6A.mjs";
17
17
  import "./chunk-3VIPMWAG.mjs";
18
18
  import "./chunk-QF65JGNW.mjs";
19
19
  import "./chunk-ZNKIYZRQ.mjs";
package/dist/vite.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkML4F4ZPYjs = require('./chunk-ML4F4ZPY.js');
3
+ var _chunkPIVX3SXUjs = require('./chunk-PIVX3SXU.js');
4
4
  require('./chunk-ORSWL3MI.js');
5
5
  require('./chunk-LTJQUORK.js');
6
- require('./chunk-477TX4LM.js');
7
- require('./chunk-63LJ4WHF.js');
6
+ require('./chunk-I7VIMPUB.js');
7
+ require('./chunk-7UBHTADV.js');
8
8
  require('./chunk-J4MI4EJO.js');
9
9
  require('./chunk-3URI7W6X.js');
10
10
  require('./chunk-UW3WHSZ5.js');
11
11
  require('./chunk-MB4BR57E.js');
12
12
 
13
13
 
14
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkML4F4ZPYjs.UnifiedViteWeappTailwindcssPlugin;
14
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkPIVX3SXUjs.UnifiedViteWeappTailwindcssPlugin;
package/dist/vite.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  UnifiedViteWeappTailwindcssPlugin
3
- } from "./chunk-2HIXWVX2.mjs";
3
+ } from "./chunk-K3XO75VC.mjs";
4
4
  import "./chunk-3SKEY32E.mjs";
5
5
  import "./chunk-RRHPTTCP.mjs";
6
- import "./chunk-7UAU27KZ.mjs";
7
- import "./chunk-ZC5JYOAR.mjs";
6
+ import "./chunk-FQX7YIN5.mjs";
7
+ import "./chunk-QYYQDG6A.mjs";
8
8
  import "./chunk-3VIPMWAG.mjs";
9
9
  import "./chunk-QF65JGNW.mjs";
10
10
  import "./chunk-ZNKIYZRQ.mjs";
package/dist/webpack.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunk2AWOAQD3js = require('./chunk-2AWOAQD3.js');
5
- require('./chunk-6VSFN3NA.js');
4
+ var _chunkW3CX5DGRjs = require('./chunk-W3CX5DGR.js');
5
+ require('./chunk-DGL3SP2H.js');
6
6
  require('./chunk-ORSWL3MI.js');
7
7
  require('./chunk-LTJQUORK.js');
8
- require('./chunk-477TX4LM.js');
9
- require('./chunk-63LJ4WHF.js');
8
+ require('./chunk-I7VIMPUB.js');
9
+ require('./chunk-7UBHTADV.js');
10
10
  require('./chunk-J4MI4EJO.js');
11
11
  require('./chunk-3URI7W6X.js');
12
12
  require('./chunk-UW3WHSZ5.js');
@@ -14,4 +14,4 @@ require('./chunk-MB4BR57E.js');
14
14
 
15
15
 
16
16
 
17
- exports.UnifiedWebpackPluginV5 = _chunk2AWOAQD3js.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunk2AWOAQD3js.weappTailwindcssPackageDir;
17
+ exports.UnifiedWebpackPluginV5 = _chunkW3CX5DGRjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkW3CX5DGRjs.weappTailwindcssPackageDir;
package/dist/webpack.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  UnifiedWebpackPluginV5,
3
3
  weappTailwindcssPackageDir
4
- } from "./chunk-HJWY5Y6L.mjs";
5
- import "./chunk-FSI2IWUY.mjs";
4
+ } from "./chunk-7LRI7LJO.mjs";
5
+ import "./chunk-XRYCPSQC.mjs";
6
6
  import "./chunk-3SKEY32E.mjs";
7
7
  import "./chunk-RRHPTTCP.mjs";
8
- import "./chunk-7UAU27KZ.mjs";
9
- import "./chunk-ZC5JYOAR.mjs";
8
+ import "./chunk-FQX7YIN5.mjs";
9
+ import "./chunk-QYYQDG6A.mjs";
10
10
  import "./chunk-3VIPMWAG.mjs";
11
11
  import "./chunk-QF65JGNW.mjs";
12
12
  import "./chunk-ZNKIYZRQ.mjs";
package/dist/webpack4.js CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- var _chunk6VSFN3NAjs = require('./chunk-6VSFN3NA.js');
12
+ var _chunkDGL3SP2Hjs = require('./chunk-DGL3SP2H.js');
13
13
 
14
14
 
15
15
 
@@ -22,14 +22,14 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
22
22
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
23
23
 
24
24
 
25
- var _chunk477TX4LMjs = require('./chunk-477TX4LM.js');
25
+ var _chunkI7VIMPUBjs = require('./chunk-I7VIMPUB.js');
26
26
 
27
27
 
28
28
 
29
29
 
30
30
 
31
31
 
32
- var _chunk63LJ4WHFjs = require('./chunk-63LJ4WHF.js');
32
+ var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.js');
33
33
  require('./chunk-J4MI4EJO.js');
34
34
  require('./chunk-3URI7W6X.js');
35
35
 
@@ -42,11 +42,11 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
42
42
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
43
43
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
44
44
  var _webpacksources = require('webpack-sources');
45
- var debug = _chunk63LJ4WHFjs.createDebug.call(void 0, );
45
+ var debug = _chunk7UBHTADVjs.createDebug.call(void 0, );
46
46
  var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
47
47
  var UnifiedWebpackPluginV4 = class {
48
48
  constructor(options = {}) {
49
- this.options = _chunk63LJ4WHFjs.getCompilerContext.call(void 0, options);
49
+ this.options = _chunk7UBHTADVjs.getCompilerContext.call(void 0, options);
50
50
  this.appType = this.options.appType;
51
51
  }
52
52
  apply(compiler) {
@@ -70,19 +70,19 @@ var UnifiedWebpackPluginV4 = class {
70
70
  const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
71
71
  const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
72
72
  const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
73
- const isMpxApp = _chunk6VSFN3NAjs.isMpx.call(void 0, this.appType);
73
+ const isMpxApp = _chunkDGL3SP2Hjs.isMpx.call(void 0, this.appType);
74
74
  if (shouldRewriteCssImports) {
75
- _chunk6VSFN3NAjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
75
+ _chunkDGL3SP2Hjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
76
76
  pkgDir: weappTailwindcssPackageDir,
77
77
  enabled: true,
78
78
  appType: this.appType
79
79
  });
80
- _chunk6VSFN3NAjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
80
+ _chunkDGL3SP2Hjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
81
81
  }
82
82
  if (disabledOptions.plugin) {
83
83
  return;
84
84
  }
85
- const patchRecorderState = _chunk477TX4LMjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
85
+ const patchRecorderState = _chunkI7VIMPUBjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
86
86
  source: "runtime",
87
87
  cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
88
88
  });
@@ -93,12 +93,12 @@ var UnifiedWebpackPluginV4 = class {
93
93
  onPatchCompleted: patchRecorderState.onPatchCompleted
94
94
  };
95
95
  const refreshRuntimeState = async (force) => {
96
- await _chunk63LJ4WHFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
96
+ await _chunk7UBHTADVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
97
97
  };
98
98
  async function getClassSetInLoader() {
99
99
  await refreshRuntimeState(true);
100
100
  await runtimeState.patchPromise;
101
- await _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
101
+ await _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
102
102
  }
103
103
  const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
104
104
  const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
@@ -111,16 +111,16 @@ var UnifiedWebpackPluginV4 = class {
111
111
  const classSetLoaderOptions = {
112
112
  getClassSet: getClassSetInLoader
113
113
  };
114
- const { findRewriteAnchor, findClassSetAnchor } = _chunk6VSFN3NAjs.createLoaderAnchorFinders.call(void 0, this.appType);
114
+ const { findRewriteAnchor, findClassSetAnchor } = _chunkDGL3SP2Hjs.createLoaderAnchorFinders.call(void 0, this.appType);
115
115
  const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
116
116
  rewriteCssImports: runtimeLoaderRewriteOptions
117
117
  } : void 0;
118
118
  onLoad();
119
119
  if (shouldRewriteCssImports && isMpxApp) {
120
- _chunk6VSFN3NAjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
120
+ _chunkDGL3SP2Hjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
121
121
  }
122
122
  if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
123
- _chunk6VSFN3NAjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
123
+ _chunkDGL3SP2Hjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
124
124
  }
125
125
  const createRuntimeClassSetLoaderEntry = () => ({
126
126
  loader: runtimeClassSetLoader,
@@ -139,19 +139,19 @@ var UnifiedWebpackPluginV4 = class {
139
139
  type: null
140
140
  };
141
141
  };
142
- compiler.hooks.compilation.tap(_chunk63LJ4WHFjs.pluginName, (compilation) => {
143
- compilation.hooks.normalModuleLoader.tap(_chunk63LJ4WHFjs.pluginName, (_loaderContext, module) => {
142
+ compiler.hooks.compilation.tap(_chunk7UBHTADVjs.pluginName, (compilation) => {
143
+ compilation.hooks.normalModuleLoader.tap(_chunk7UBHTADVjs.pluginName, (_loaderContext, module) => {
144
144
  const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
145
145
  if (!hasRuntimeLoader) {
146
146
  return;
147
147
  }
148
- if (shouldRewriteCssImports && _chunk6VSFN3NAjs.isMpx.call(void 0, this.appType) && typeof _loaderContext.resolve === "function") {
149
- _chunk6VSFN3NAjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, true);
148
+ if (shouldRewriteCssImports && _chunkDGL3SP2Hjs.isMpx.call(void 0, this.appType) && typeof _loaderContext.resolve === "function") {
149
+ _chunkDGL3SP2Hjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, true);
150
150
  }
151
151
  const loaderEntries = module.loaders || [];
152
152
  let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
153
153
  const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
154
- const isCssModule = _chunk6VSFN3NAjs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
154
+ const isCssModule = _chunkDGL3SP2Hjs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
155
155
  if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
156
156
  debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
157
157
  }
@@ -185,7 +185,7 @@ var UnifiedWebpackPluginV4 = class {
185
185
  rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
186
186
  }
187
187
  }
188
- if (runtimeClassSetLoaderExists && !_chunk6VSFN3NAjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
188
+ if (runtimeClassSetLoaderExists && !_chunkDGL3SP2Hjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
189
189
  const anchorIndex = findClassSetAnchor(loaderEntries);
190
190
  if (anchorIndex === -1) {
191
191
  anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
@@ -196,7 +196,7 @@ var UnifiedWebpackPluginV4 = class {
196
196
  }
197
197
  });
198
198
  });
199
- compiler.hooks.emit.tapPromise(_chunk63LJ4WHFjs.pluginName, async (compilation) => {
199
+ compiler.hooks.emit.tapPromise(_chunk7UBHTADVjs.pluginName, async (compilation) => {
200
200
  await runtimeState.patchPromise;
201
201
  onStart();
202
202
  debug("start");
@@ -262,7 +262,7 @@ var UnifiedWebpackPluginV4 = class {
262
262
  const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
263
263
  await refreshRuntimeState(true);
264
264
  await runtimeState.patchPromise;
265
- const runtimeSet = await _chunk63LJ4WHFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
265
+ const runtimeSet = await _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
266
266
  debug("get runtimeSet, class count: %d", runtimeSet.size);
267
267
  const tasks = [];
268
268
  if (Array.isArray(groupedEntries.html)) {
@@ -299,7 +299,7 @@ var UnifiedWebpackPluginV4 = class {
299
299
  const jsTaskFactories = [];
300
300
  if (Array.isArray(groupedEntries.js)) {
301
301
  for (const [file] of groupedEntries.js) {
302
- const cacheKey = _chunk6VSFN3NAjs.getCacheKey.call(void 0, file);
302
+ const cacheKey = _chunkDGL3SP2Hjs.getCacheKey.call(void 0, file);
303
303
  const assetSource = compilation.assets[file];
304
304
  if (!assetSource) {
305
305
  continue;
package/dist/webpack4.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  isMpx,
10
10
  patchMpxLoaderResolve,
11
11
  setupMpxTailwindcssRedirect
12
- } from "./chunk-FSI2IWUY.mjs";
12
+ } from "./chunk-XRYCPSQC.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-7UAU27KZ.mjs";
25
+ } from "./chunk-FQX7YIN5.mjs";
26
26
  import {
27
27
  collectRuntimeClassSet,
28
28
  createDebug,
29
29
  getCompilerContext,
30
30
  pluginName,
31
31
  refreshTailwindRuntimeState
32
- } from "./chunk-ZC5JYOAR.mjs";
32
+ } from "./chunk-QYYQDG6A.mjs";
33
33
  import "./chunk-3VIPMWAG.mjs";
34
34
  import "./chunk-QF65JGNW.mjs";
35
35
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
- "version": "4.8.14",
3
+ "version": "4.8.15",
4
4
  "description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -184,8 +184,8 @@
184
184
  "tailwindcss-patch": "^8.5.0",
185
185
  "webpack-sources": "3.3.3",
186
186
  "yaml": "^2.8.2",
187
- "@weapp-tailwindcss/logger": "1.1.0",
188
187
  "@weapp-tailwindcss/shared": "1.1.1",
188
+ "@weapp-tailwindcss/logger": "1.1.0",
189
189
  "@weapp-tailwindcss/postcss": "2.1.0"
190
190
  },
191
191
  "scripts": {