weapp-tailwindcss 3.8.0-alpha.0 → 3.8.0-alpha.2

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 (77) hide show
  1. package/dist/{chunk-T4A3DCFN.mjs → chunk-7BX3PGSW.mjs} +2 -2
  2. package/dist/{chunk-WMQLIT4T.js → chunk-BY4T6WET.js} +10 -10
  3. package/dist/chunk-EHEK77RO.js +10 -0
  4. package/dist/{chunk-K7CL4YBQ.mjs → chunk-FQGZYB5X.mjs} +5 -5
  5. package/dist/{chunk-AXBFBHS2.mjs → chunk-FSYVGTJO.mjs} +12 -0
  6. package/dist/chunk-FXPGR372.js +1 -0
  7. package/dist/{chunk-VFCTLSC3.mjs → chunk-IS6WLJ6U.mjs} +19 -128
  8. package/dist/{chunk-C7DFN4K3.js → chunk-KQ4TG7V3.js} +11 -11
  9. package/dist/chunk-L7PW3J3N.mjs +10 -0
  10. package/dist/chunk-LOLJLZCX.mjs +0 -0
  11. package/dist/chunk-NXBCP4JC.js +118 -0
  12. package/dist/{chunk-6FNC3XMI.js → chunk-R3QJNUYU.js} +13 -1
  13. package/dist/{chunk-QJPVKPQS.js → chunk-SLGPM54R.js} +29 -138
  14. package/dist/{chunk-A2EDVNQK.mjs → chunk-WNZKXLOB.mjs} +5 -5
  15. package/dist/{chunk-7J6ZENMS.js → chunk-WX3XJ7PY.js} +12 -12
  16. package/dist/chunk-Y4JDXXJ2.mjs +118 -0
  17. package/dist/cli.js +9 -10
  18. package/dist/cli.mjs +7 -8
  19. package/dist/core.d.mts +3 -4
  20. package/dist/core.d.ts +3 -4
  21. package/dist/core.js +5 -7
  22. package/dist/core.mjs +4 -6
  23. package/dist/css-macro/postcss.js +1 -1
  24. package/dist/css-macro/postcss.mjs +1 -1
  25. package/dist/css-macro.js +1 -1
  26. package/dist/css-macro.mjs +1 -1
  27. package/dist/defaults.d.mts +5 -6
  28. package/dist/defaults.d.ts +5 -6
  29. package/dist/defaults.js +3 -3
  30. package/dist/defaults.mjs +4 -4
  31. package/dist/escape.d.mts +6 -6
  32. package/dist/escape.d.ts +6 -6
  33. package/dist/escape.js +1 -1
  34. package/dist/escape.mjs +1 -1
  35. package/dist/gulp.d.mts +3 -4
  36. package/dist/gulp.d.ts +3 -4
  37. package/dist/gulp.js +6 -8
  38. package/dist/gulp.mjs +5 -7
  39. package/dist/index.d.mts +3 -4
  40. package/dist/index.d.ts +3 -4
  41. package/dist/index.js +11 -11
  42. package/dist/index.mjs +9 -9
  43. package/dist/{index-g4epDIUu.d.mts → types.d.mts} +7 -192
  44. package/dist/{index-g4epDIUu.d.ts → types.d.ts} +7 -192
  45. package/dist/types.js +1 -0
  46. package/dist/types.mjs +1 -0
  47. package/dist/vite.d.mts +3 -4
  48. package/dist/vite.d.ts +3 -4
  49. package/dist/vite.js +7 -8
  50. package/dist/vite.mjs +6 -7
  51. package/dist/weapp-tw-runtime-loader.js +1 -1
  52. package/dist/weapp-tw-runtime-loader.mjs +1 -1
  53. package/dist/webpack.d.mts +3 -4
  54. package/dist/webpack.d.ts +3 -4
  55. package/dist/webpack.js +7 -8
  56. package/dist/webpack.mjs +6 -7
  57. package/dist/webpack4.d.mts +3 -4
  58. package/dist/webpack4.d.ts +3 -4
  59. package/dist/webpack4.js +13 -14
  60. package/dist/webpack4.mjs +7 -8
  61. package/package.json +12 -18
  62. package/dist/chunk-FYOOMUKL.js +0 -115
  63. package/dist/chunk-JVPRWRPJ.mjs +0 -115
  64. package/dist/chunk-KE7J6XFD.mjs +0 -537
  65. package/dist/chunk-LQN2VTMU.js +0 -537
  66. package/dist/chunk-VKSQ6BRD.mjs +0 -27
  67. package/dist/chunk-XSZXPWWL.js +0 -27
  68. package/dist/postcss.d.mts +0 -28
  69. package/dist/postcss.d.ts +0 -28
  70. package/dist/postcss.js +0 -16
  71. package/dist/postcss.mjs +0 -16
  72. package/dist/replace.d.mts +0 -22
  73. package/dist/replace.d.ts +0 -22
  74. package/dist/replace.js +0 -33
  75. package/dist/replace.mjs +0 -33
  76. package/dist/shared-5ArEo9kL.d.mts +0 -5
  77. package/dist/shared-DI2Qz1ou.d.ts +0 -5
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-75EWCRQW.mjs";
4
4
  import {
5
5
  getOptions
6
- } from "./chunk-VFCTLSC3.mjs";
6
+ } from "./chunk-IS6WLJ6U.mjs";
7
7
  import {
8
8
  __async,
9
9
  __spreadValues
10
- } from "./chunk-AXBFBHS2.mjs";
10
+ } from "./chunk-FSYVGTJO.mjs";
11
11
 
12
12
  // src/bundlers/gulp/index.ts
13
13
  import { Buffer } from "node:buffer";
@@ -3,21 +3,21 @@
3
3
  var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
4
4
 
5
5
 
6
- var _chunkQJPVKPQSjs = require('./chunk-QJPVKPQS.js');
6
+ var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
7
7
 
8
8
 
9
- var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
9
+ var _chunkSLGPM54Rjs = require('./chunk-SLGPM54R.js');
10
10
 
11
11
 
12
- var _chunkLQN2VTMUjs = require('./chunk-LQN2VTMU.js');
12
+ var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
13
13
 
14
14
 
15
- var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
15
+ var _chunkR3QJNUYUjs = require('./chunk-R3QJNUYU.js');
16
16
 
17
17
  // src/bundlers/vite/index.ts
18
18
  var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
19
19
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
20
- const opts = _chunkQJPVKPQSjs.getOptions.call(void 0, options);
20
+ const opts = _chunkSLGPM54Rjs.getOptions.call(void 0, options);
21
21
  const {
22
22
  disabled,
23
23
  onEnd,
@@ -40,10 +40,10 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
40
40
  patch == null ? void 0 : patch();
41
41
  onLoad();
42
42
  return {
43
- name: _chunkLQN2VTMUjs.vitePluginName,
43
+ name: _chunkEHEK77ROjs.vitePluginName,
44
44
  enforce: "post",
45
45
  generateBundle(_opt, bundle) {
46
- return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
46
+ return _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
47
47
  debug("start");
48
48
  onStart();
49
49
  const entries = Object.entries(bundle);
@@ -69,7 +69,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
69
69
  return false;
70
70
  }
71
71
  },
72
- () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
72
+ () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
73
73
  originalSource.source = yield templateHandler(oldVal, {
74
74
  runtimeSet
75
75
  });
@@ -103,7 +103,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
103
103
  return false;
104
104
  }
105
105
  },
106
- () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
106
+ () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
107
107
  const mapFilename = `${file}.map`;
108
108
  const hasMap = Boolean(bundle[mapFilename]);
109
109
  const { code, map } = yield jsHandler(rawSource, runtimeSet, {
@@ -144,7 +144,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
144
144
  return false;
145
145
  }
146
146
  },
147
- () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
147
+ () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
148
148
  const { css } = yield styleHandler(rawSource, {
149
149
  isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
150
150
  });
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/constants.ts
2
+ var pluginName = "weapp-tailwindcss-webpack-plugin";
3
+ var vitePluginName = "vite-plugin-uni-app-weapp-tailwindcss-adaptor";
4
+ var WEAPP_TW_REQUIRED_NODE_VERSION = "18.17.0";
5
+
6
+
7
+
8
+
9
+
10
+ exports.pluginName = pluginName; exports.vitePluginName = vitePluginName; exports.WEAPP_TW_REQUIRED_NODE_VERSION = WEAPP_TW_REQUIRED_NODE_VERSION;
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  createDebug
3
3
  } from "./chunk-75EWCRQW.mjs";
4
+ import {
5
+ pluginName
6
+ } from "./chunk-L7PW3J3N.mjs";
4
7
  import {
5
8
  getOptions
6
- } from "./chunk-VFCTLSC3.mjs";
9
+ } from "./chunk-IS6WLJ6U.mjs";
7
10
  import {
8
11
  getGroupedEntries,
9
12
  removeExt
10
13
  } from "./chunk-MUJ65IQ3.mjs";
11
- import {
12
- pluginName
13
- } from "./chunk-KE7J6XFD.mjs";
14
14
  import {
15
15
  __async
16
- } from "./chunk-AXBFBHS2.mjs";
16
+ } from "./chunk-FSYVGTJO.mjs";
17
17
 
18
18
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
19
19
  import fs from "node:fs";
@@ -1,6 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
6
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -17,6 +19,15 @@ var __spreadValues = (a, b) => {
17
19
  return a;
18
20
  };
19
21
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (let key of __getOwnPropNames(from))
25
+ if (!__hasOwnProp.call(to, key) && key !== except)
26
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ }
28
+ return to;
29
+ };
30
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
31
  var __async = (__this, __arguments, generator) => {
21
32
  return new Promise((resolve, reject) => {
22
33
  var fulfilled = (value) => {
@@ -41,5 +52,6 @@ var __async = (__this, __arguments, generator) => {
41
52
  export {
42
53
  __spreadValues,
43
54
  __spreadProps,
55
+ __reExport,
44
56
  __async
45
57
  };
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,21 +1,19 @@
1
1
  import {
2
- defaultOptions
3
- } from "./chunk-JVPRWRPJ.mjs";
2
+ replaceWxml
3
+ } from "./chunk-U7O2XXYR.mjs";
4
+ import {
5
+ getDefaultOptions
6
+ } from "./chunk-Y4JDXXJ2.mjs";
4
7
  import {
5
8
  defuOverrideArray,
6
9
  isMap
7
10
  } from "./chunk-MUJ65IQ3.mjs";
8
- import {
9
- getPlugins
10
- } from "./chunk-KE7J6XFD.mjs";
11
- import {
12
- replaceWxml
13
- } from "./chunk-U7O2XXYR.mjs";
14
11
  import {
15
12
  __async,
13
+ __reExport,
16
14
  __spreadProps,
17
15
  __spreadValues
18
- } from "./chunk-AXBFBHS2.mjs";
16
+ } from "./chunk-FSYVGTJO.mjs";
19
17
 
20
18
  // src/logger.ts
21
19
  import { logger } from "@weapp-tailwindcss/logger";
@@ -105,16 +103,7 @@ import MagicString from "magic-string";
105
103
  // src/js/handlers.ts
106
104
  import { jsStringEscape } from "@ast-core/escape";
107
105
  import { escapeStringRegexp } from "@weapp-core/regex";
108
-
109
- // src/extractors/split.ts
110
- var validateFilterRE = /[\w\u00A0-\uFFFF%-?]/;
111
- function isValidSelector(selector = "") {
112
- return validateFilterRE.test(selector);
113
- }
114
- function splitCode(code, allowDoubleQuotes = false) {
115
- const splitter = allowDoubleQuotes ? /\s+/ : /\s+|"/;
116
- return code.split(splitter).filter((element) => isValidSelector(element));
117
- }
106
+ import { splitCode } from "@weapp-tailwindcss/shared/extractors";
118
107
 
119
108
  // src/utils/decode.ts
120
109
  function decodeUnicode2(input) {
@@ -475,112 +464,14 @@ function createJsHandler(options) {
475
464
  }
476
465
 
477
466
  // src/mangle/index.ts
478
- import { ClassGenerator, defaultMangleClassFilter } from "@tailwindcss-mangle/shared";
479
- import { escapeStringRegexp as escapeStringRegexp2 } from "@weapp-core/regex";
480
- function getSelf(x) {
481
- return x;
482
- }
483
- var defaultMangleContext = {
484
- rawOptions: false,
485
- runtimeSet: /* @__PURE__ */ new Set(),
486
- classGenerator: new ClassGenerator(),
487
- filter: defaultMangleClassFilter,
488
- cssHandler: getSelf,
489
- jsHandler: getSelf,
490
- wxmlHandler: getSelf
491
- };
492
- function useMangleStore() {
493
- const ctx = Object.assign({}, defaultMangleContext);
494
- function resetMangle() {
495
- return Object.assign(ctx, defaultMangleContext);
496
- }
497
- function handleValue(rawSource) {
498
- const arr = splitCode(rawSource);
499
- for (const x of arr) {
500
- if (ctx.runtimeSet.has(x)) {
501
- rawSource = rawSource.replace(new RegExp(escapeStringRegexp2(x)), ctx.classGenerator.generateClassName(x).name);
502
- }
503
- }
504
- return rawSource;
505
- }
506
- function initMangle(options) {
507
- var _a;
508
- ctx.rawOptions = options;
509
- if (options) {
510
- if (options === true) {
511
- options = {
512
- classGenerator: {},
513
- mangleClassFilter: defaultMangleClassFilter
514
- };
515
- }
516
- ctx.classGenerator = new ClassGenerator(options.classGenerator);
517
- ctx.filter = (_a = options.mangleClassFilter) != null ? _a : defaultMangleClassFilter;
518
- ctx.jsHandler = (rawSource) => {
519
- return handleValue(rawSource);
520
- };
521
- ctx.cssHandler = (rawSource) => {
522
- return handleValue(rawSource);
523
- };
524
- ctx.wxmlHandler = (rawSource) => {
525
- return handleValue(rawSource);
526
- };
527
- }
528
- }
529
- function setMangleRuntimeSet(runtimeSet) {
530
- const newSet = /* @__PURE__ */ new Set();
531
- for (const c of runtimeSet) {
532
- if (ctx.filter(c)) {
533
- newSet.add(c);
534
- }
535
- }
536
- ctx.runtimeSet = newSet;
537
- }
538
- return {
539
- mangleContext: ctx,
540
- resetMangle,
541
- initMangle,
542
- setMangleRuntimeSet
543
- };
544
- }
467
+ var mangle_exports = {};
468
+ __reExport(mangle_exports, mangle_star);
469
+ import * as mangle_star from "@weapp-tailwindcss/mangle";
545
470
 
546
471
  // src/postcss/index.ts
547
- import postcss from "postcss";
548
- function styleHandler(rawSource, options) {
549
- var _a, _b;
550
- return postcss(getPlugins(options)).process(
551
- rawSource,
552
- (_b = (_a = options.postcssOptions) == null ? void 0 : _a.options) != null ? _b : {
553
- from: void 0
554
- }
555
- ).async();
556
- }
557
- function createStyleHandler(options) {
558
- return (rawSource, opt) => {
559
- return styleHandler(
560
- rawSource,
561
- defuOverrideArray(opt, options)
562
- );
563
- };
564
- }
565
-
566
- // src/postcss/preflight.ts
567
- function createInjectPreflight(options) {
568
- const result = [];
569
- if (options && typeof options === "object") {
570
- const entries = Object.entries(options);
571
- for (const [prop, value] of entries) {
572
- if (value !== false) {
573
- result.push({
574
- prop,
575
- value: value.toString()
576
- });
577
- }
578
- }
579
- }
580
- return () => {
581
- return result;
582
- };
583
- }
472
+ var postcss_exports = {};
473
+ __reExport(postcss_exports, postcss_star);
474
+ import * as postcss_star from "@weapp-tailwindcss/postcss";
584
475
 
585
476
  // src/tailwindcss/patcher.ts
586
477
  import path from "node:path";
@@ -920,7 +811,7 @@ function createTemplateHandler(options = {}) {
920
811
  function getOptions(opts) {
921
812
  const result = defuOverrideArray(
922
813
  opts,
923
- defaultOptions,
814
+ getDefaultOptions(),
924
815
  {}
925
816
  );
926
817
  result.escapeMap = result.customReplaceDictionary;
@@ -950,11 +841,11 @@ function getOptions(opts) {
950
841
  ignoreCallExpressionIdentifiers,
951
842
  ignoreTaggedTemplateExpressionIdentifiers
952
843
  } = result;
953
- const cssInjectPreflight = createInjectPreflight(cssPreflight);
844
+ const cssInjectPreflight = (0, postcss_exports.createInjectPreflight)(cssPreflight);
954
845
  const customAttributesEntities = isMap(customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
955
- const { initMangle, mangleContext, setMangleRuntimeSet } = useMangleStore();
846
+ const { initMangle, mangleContext, setMangleRuntimeSet } = (0, mangle_exports.useMangleStore)();
956
847
  initMangle(mangle);
957
- const styleHandler2 = createStyleHandler({
848
+ const styleHandler = (0, postcss_exports.createStyleHandler)({
958
849
  cssInjectPreflight,
959
850
  customRuleCallback,
960
851
  cssPreflightRange,
@@ -986,7 +877,7 @@ function getOptions(opts) {
986
877
  jsHandler: jsHandler2,
987
878
  disabledDefaultTemplateHandler
988
879
  });
989
- result.styleHandler = styleHandler2;
880
+ result.styleHandler = styleHandler;
990
881
  result.jsHandler = jsHandler2;
991
882
  result.templateHandler = templateHandler;
992
883
  const twPatcher = createTailwindcssPatcher(tailwindcssBasedir, appType === "mpx" ? "node_modules/tailwindcss-patch/.cache" : void 0, supportCustomLengthUnitsPatch != null ? supportCustomLengthUnitsPatch : true);
@@ -3,11 +3,11 @@
3
3
  var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
4
4
 
5
5
 
6
- var _chunkQJPVKPQSjs = require('./chunk-QJPVKPQS.js');
6
+ var _chunkSLGPM54Rjs = require('./chunk-SLGPM54R.js');
7
7
 
8
8
 
9
9
 
10
- var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
10
+ var _chunkR3QJNUYUjs = require('./chunk-R3QJNUYU.js');
11
11
 
12
12
  // src/bundlers/gulp/index.ts
13
13
  var _buffer = require('buffer');
@@ -15,7 +15,7 @@ var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
15
15
  var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
16
16
  var Transform = _stream2.default.Transform;
17
17
  function createPlugins(options = {}) {
18
- const opts = _chunkQJPVKPQSjs.getOptions.call(void 0, options);
18
+ const opts = _chunkSLGPM54Rjs.getOptions.call(void 0, options);
19
19
  const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
20
20
  let runtimeSet = /* @__PURE__ */ new Set();
21
21
  patch == null ? void 0 : patch();
@@ -23,7 +23,7 @@ function createPlugins(options = {}) {
23
23
  return new Transform({
24
24
  objectMode: true,
25
25
  transform(file, _encoding, callback) {
26
- return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
26
+ return _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
27
27
  runtimeSet = twPatcher.getClassSet();
28
28
  setMangleRuntimeSet(runtimeSet);
29
29
  const error = null;
@@ -42,8 +42,8 @@ function createPlugins(options = {}) {
42
42
  return false;
43
43
  }
44
44
  },
45
- () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
46
- const { css } = yield styleHandler(rawSource, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {
45
+ () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
46
+ const { css } = yield styleHandler(rawSource, _chunkR3QJNUYUjs.__spreadValues.call(void 0, {
47
47
  isMainChunk: true
48
48
  }, options2));
49
49
  file.contents = _buffer.Buffer.from(css);
@@ -68,7 +68,7 @@ function createPlugins(options = {}) {
68
68
  return new Transform({
69
69
  objectMode: true,
70
70
  transform(file, _encoding, callback) {
71
- return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
71
+ return _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
72
72
  const error = null;
73
73
  if (file.contents) {
74
74
  const rawSource = file.contents.toString();
@@ -85,7 +85,7 @@ function createPlugins(options = {}) {
85
85
  return false;
86
86
  }
87
87
  },
88
- () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
88
+ () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
89
89
  const { code } = yield jsHandler(rawSource, runtimeSet, options2);
90
90
  file.contents = _buffer.Buffer.from(code);
91
91
  debug("js handle: %s", file.path);
@@ -105,7 +105,7 @@ function createPlugins(options = {}) {
105
105
  return new Transform({
106
106
  objectMode: true,
107
107
  transform(file, _encoding, callback) {
108
- return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
108
+ return _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
109
109
  const error = null;
110
110
  if (file.contents) {
111
111
  const rawSource = file.contents.toString();
@@ -122,8 +122,8 @@ function createPlugins(options = {}) {
122
122
  return false;
123
123
  }
124
124
  },
125
- () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
126
- const code = yield templateHandler(rawSource, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {
125
+ () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
126
+ const code = yield templateHandler(rawSource, _chunkR3QJNUYUjs.__spreadValues.call(void 0, {
127
127
  runtimeSet
128
128
  }, options2));
129
129
  file.contents = _buffer.Buffer.from(code);
@@ -0,0 +1,10 @@
1
+ // src/constants.ts
2
+ var pluginName = "weapp-tailwindcss-webpack-plugin";
3
+ var vitePluginName = "vite-plugin-uni-app-weapp-tailwindcss-adaptor";
4
+ var WEAPP_TW_REQUIRED_NODE_VERSION = "18.17.0";
5
+
6
+ export {
7
+ pluginName,
8
+ vitePluginName,
9
+ WEAPP_TW_REQUIRED_NODE_VERSION
10
+ };
File without changes
@@ -0,0 +1,118 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
4
+
5
+ // src/defaults.ts
6
+ var _escape = require('@weapp-core/escape');
7
+ var _localpkg = require('local-pkg');
8
+ function getDefaultOptions() {
9
+ return {
10
+ /**
11
+ * wxss 微信小程序
12
+ * acss 支付宝小程序
13
+ * jxss 京东小程序
14
+ * ttss 头条小程序
15
+ * qss QQ小程序
16
+ * css 最正常的样式文件
17
+ * tyss 涂鸦小程序
18
+ */
19
+ cssMatcher: (file) => /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/.test(file),
20
+ /**
21
+ * wxml 微信小程序
22
+ * axml 支付宝小程序
23
+ * jxml 京东小程序
24
+ * ksml 快手小程序
25
+ * ttml 头条小程序
26
+ * qml QQ小程序
27
+ * tyml 涂鸦小程序
28
+ * xhsml 小红书小程序
29
+ * swan 百度小程序
30
+ */
31
+ htmlMatcher: (file) => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/.test(file),
32
+ jsMatcher: (file) => {
33
+ if (file.includes("node_modules")) {
34
+ return false;
35
+ }
36
+ return /.+\.[cm]?js?$/.test(file);
37
+ },
38
+ mainCssChunkMatcher: (file, appType) => {
39
+ switch (appType) {
40
+ case "uni-app": {
41
+ return file.startsWith("common/main");
42
+ }
43
+ case "uni-app-vite": {
44
+ return file.startsWith("app") || file.startsWith("common/main");
45
+ }
46
+ case "mpx": {
47
+ return file.startsWith("app");
48
+ }
49
+ case "taro": {
50
+ return file.startsWith("app");
51
+ }
52
+ case "remax": {
53
+ return file.startsWith("app");
54
+ }
55
+ case "rax": {
56
+ return file.startsWith("bundle");
57
+ }
58
+ case "native": {
59
+ return file.startsWith("app");
60
+ }
61
+ case "kbone": {
62
+ return /^(?:common\/)?miniprogram-app/.test(file);
63
+ }
64
+ default: {
65
+ return true;
66
+ }
67
+ }
68
+ },
69
+ wxsMatcher: () => {
70
+ return false;
71
+ },
72
+ // https://tailwindcss.com/docs/preflight#border-styles-are-reset-globally
73
+ cssPreflight: {
74
+ "box-sizing": "border-box",
75
+ "border-width": "0",
76
+ "border-style": "solid",
77
+ "border-color": "currentColor"
78
+ },
79
+ disabled: false,
80
+ customRuleCallback: _chunk35CYTBPMjs.noop,
81
+ onLoad: _chunk35CYTBPMjs.noop,
82
+ onStart: _chunk35CYTBPMjs.noop,
83
+ onEnd: _chunk35CYTBPMjs.noop,
84
+ onUpdate: _chunk35CYTBPMjs.noop,
85
+ customAttributes: {},
86
+ customReplaceDictionary: _escape.SimpleMappingChars2String,
87
+ appType: void 0,
88
+ arbitraryValues: {
89
+ allowDoubleQuotes: false
90
+ },
91
+ cssChildCombinatorReplaceValue: ["view"],
92
+ inlineWxs: false,
93
+ injectAdditionalCssVarScope: false,
94
+ jsPreserveClass: (keyword) => {
95
+ if (keyword === "*") {
96
+ return true;
97
+ }
98
+ return false;
99
+ },
100
+ disabledDefaultTemplateHandler: false,
101
+ cssSelectorReplacement: {
102
+ root: "page",
103
+ universal: ["view", "text"]
104
+ },
105
+ babelParserOptions: {
106
+ sourceType: "unambiguous"
107
+ },
108
+ postcssOptions: {},
109
+ cssRemoveHoverPseudoClass: true,
110
+ ignoreCallExpressionIdentifiers: _localpkg.isPackageExists.call(void 0, "@weapp-tailwindcss/merge") ? ["cn", "cva"] : [],
111
+ ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"]
112
+ // jsAstTool: 'ast-grep'
113
+ };
114
+ }
115
+
116
+
117
+
118
+ exports.getDefaultOptions = getDefaultOptions;
@@ -1,6 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
6
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -17,6 +19,15 @@ var __spreadValues = (a, b) => {
17
19
  return a;
18
20
  };
19
21
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (let key of __getOwnPropNames(from))
25
+ if (!__hasOwnProp.call(to, key) && key !== except)
26
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ }
28
+ return to;
29
+ };
30
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
31
  var __async = (__this, __arguments, generator) => {
21
32
  return new Promise((resolve, reject) => {
22
33
  var fulfilled = (value) => {
@@ -42,4 +53,5 @@ var __async = (__this, __arguments, generator) => {
42
53
 
43
54
 
44
55
 
45
- exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__async = __async;
56
+
57
+ exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__reExport = __reExport; exports.__async = __async;