weapp-tailwindcss 3.8.0-alpha.2 → 4.0.0-alpha.11

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 (61) hide show
  1. package/dist/{chunk-R3QJNUYU.js → chunk-6FNC3XMI.js} +1 -13
  2. package/dist/{chunk-FSYVGTJO.mjs → chunk-AXBFBHS2.mjs} +0 -12
  3. package/dist/{chunk-FQGZYB5X.mjs → chunk-CRIVJETU.mjs} +12 -13
  4. package/dist/{chunk-7BX3PGSW.mjs → chunk-F23L6ZME.mjs} +6 -6
  5. package/dist/{chunk-BY4T6WET.js → chunk-GHLS2DGY.js} +16 -17
  6. package/dist/{chunk-KQ4TG7V3.js → chunk-GX4O2YZI.js} +13 -13
  7. package/dist/{chunk-WX3XJ7PY.js → chunk-KVKGWZDD.js} +18 -19
  8. package/dist/{chunk-U7O2XXYR.mjs → chunk-PCBSAFQF.mjs} +2 -2
  9. package/dist/{chunk-IS6WLJ6U.mjs → chunk-PCLP6Y32.mjs} +46 -45
  10. package/dist/{chunk-Y4JDXXJ2.mjs → chunk-RHTRRSP3.mjs} +4 -4
  11. package/dist/{chunk-SLGPM54R.js → chunk-UDT6MZJ7.js} +63 -62
  12. package/dist/{chunk-RFNUATFD.js → chunk-WGQLZ5K4.js} +1 -1
  13. package/dist/{chunk-WNZKXLOB.mjs → chunk-XW3PPBN2.mjs} +12 -13
  14. package/dist/{chunk-NXBCP4JC.js → chunk-YUXG2EJF.js} +3 -3
  15. package/dist/cli.js +10 -10
  16. package/dist/cli.mjs +8 -8
  17. package/dist/core.d.mts +2 -3
  18. package/dist/core.d.ts +2 -3
  19. package/dist/core.js +12 -11
  20. package/dist/core.mjs +13 -12
  21. package/dist/css-macro/postcss.js +1 -1
  22. package/dist/css-macro/postcss.mjs +1 -1
  23. package/dist/css-macro.js +1 -1
  24. package/dist/css-macro.mjs +1 -1
  25. package/dist/defaults.d.mts +2 -3
  26. package/dist/defaults.d.ts +2 -3
  27. package/dist/defaults.js +3 -3
  28. package/dist/defaults.mjs +2 -2
  29. package/dist/escape.d.mts +2 -3
  30. package/dist/escape.d.ts +2 -3
  31. package/dist/escape.js +3 -3
  32. package/dist/escape.mjs +2 -2
  33. package/dist/gulp.d.mts +2 -3
  34. package/dist/gulp.d.ts +2 -3
  35. package/dist/gulp.js +6 -6
  36. package/dist/gulp.mjs +5 -5
  37. package/dist/index.d.mts +3 -4
  38. package/dist/index.d.ts +3 -4
  39. package/dist/index.js +9 -9
  40. package/dist/index.mjs +8 -8
  41. package/dist/types.d.mts +151 -24
  42. package/dist/types.d.ts +151 -24
  43. package/dist/vite.d.mts +3 -4
  44. package/dist/vite.d.ts +3 -4
  45. package/dist/vite.js +7 -7
  46. package/dist/vite.mjs +6 -6
  47. package/dist/weapp-tw-runtime-loader.js +1 -3
  48. package/dist/webpack.d.mts +3 -4
  49. package/dist/webpack.d.ts +3 -4
  50. package/dist/webpack.js +7 -7
  51. package/dist/webpack.mjs +6 -6
  52. package/dist/webpack4.d.mts +3 -4
  53. package/dist/webpack4.d.ts +3 -4
  54. package/dist/webpack4.js +19 -20
  55. package/dist/webpack4.mjs +14 -15
  56. package/package.json +11 -16
  57. package/dist/weapp-tw-runtime-loader.d.mts +0 -7
  58. package/dist/weapp-tw-runtime-loader.d.ts +0 -7
  59. package/dist/weapp-tw-runtime-loader.mjs +0 -14
  60. /package/dist/{chunk-L7PW3J3N.mjs → chunk-HL6Y5PYZ.mjs} +0 -0
  61. /package/dist/{chunk-EHEK77RO.js → chunk-N62XM3T3.js} +0 -0
@@ -1,8 +1,6 @@
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;
4
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -19,15 +17,6 @@ var __spreadValues = (a, b) => {
19
17
  return a;
20
18
  };
21
19
  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"));
31
20
  var __async = (__this, __arguments, generator) => {
32
21
  return new Promise((resolve, reject) => {
33
22
  var fulfilled = (value) => {
@@ -53,5 +42,4 @@ var __async = (__this, __arguments, generator) => {
53
42
 
54
43
 
55
44
 
56
-
57
- exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__reExport = __reExport; exports.__async = __async;
45
+ exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__async = __async;
@@ -1,8 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -19,15 +17,6 @@ var __spreadValues = (a, b) => {
19
17
  return a;
20
18
  };
21
19
  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"));
31
20
  var __async = (__this, __arguments, generator) => {
32
21
  return new Promise((resolve, reject) => {
33
22
  var fulfilled = (value) => {
@@ -52,6 +41,5 @@ var __async = (__this, __arguments, generator) => {
52
41
  export {
53
42
  __spreadValues,
54
43
  __spreadProps,
55
- __reExport,
56
44
  __async
57
45
  };
@@ -3,17 +3,17 @@ import {
3
3
  } from "./chunk-75EWCRQW.mjs";
4
4
  import {
5
5
  pluginName
6
- } from "./chunk-L7PW3J3N.mjs";
6
+ } from "./chunk-HL6Y5PYZ.mjs";
7
7
  import {
8
- getOptions
9
- } from "./chunk-IS6WLJ6U.mjs";
8
+ getCompilerContext
9
+ } from "./chunk-PCLP6Y32.mjs";
10
10
  import {
11
11
  getGroupedEntries,
12
12
  removeExt
13
13
  } from "./chunk-MUJ65IQ3.mjs";
14
14
  import {
15
15
  __async
16
- } from "./chunk-FSYVGTJO.mjs";
16
+ } from "./chunk-AXBFBHS2.mjs";
17
17
 
18
18
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
19
19
  import fs from "node:fs";
@@ -21,7 +21,7 @@ import path from "node:path";
21
21
  var debug = createDebug();
22
22
  var UnifiedWebpackPluginV5 = class {
23
23
  constructor(options = {}) {
24
- this.options = getOptions(options);
24
+ this.options = getCompilerContext(options);
25
25
  this.appType = this.options.appType;
26
26
  }
27
27
  apply(compiler) {
@@ -33,7 +33,6 @@ var UnifiedWebpackPluginV5 = class {
33
33
  onEnd,
34
34
  onStart,
35
35
  styleHandler,
36
- patch,
37
36
  templateHandler,
38
37
  jsHandler,
39
38
  setMangleRuntimeSet,
@@ -44,7 +43,7 @@ var UnifiedWebpackPluginV5 = class {
44
43
  if (disabled) {
45
44
  return;
46
45
  }
47
- patch == null ? void 0 : patch();
46
+ twPatcher.patch();
48
47
  const { Compilation, sources, NormalModule } = compiler.webpack;
49
48
  const { ConcatSource, RawSource } = sources;
50
49
  function getClassSet() {
@@ -90,8 +89,8 @@ var UnifiedWebpackPluginV5 = class {
90
89
  debug("get runtimeSet, class count: %d", runtimeSet.size);
91
90
  if (Array.isArray(groupedEntries.html)) {
92
91
  let noCachedCount = 0;
93
- for (let i = 0; i < groupedEntries.html.length; i++) {
94
- const [file, originalSource] = groupedEntries.html[i];
92
+ for (const element of groupedEntries.html) {
93
+ const [file, originalSource] = element;
95
94
  const rawSource = originalSource.source().toString();
96
95
  const hash = cache.computeHash(rawSource);
97
96
  const cacheKey = file;
@@ -127,8 +126,8 @@ var UnifiedWebpackPluginV5 = class {
127
126
  }
128
127
  if (Array.isArray(groupedEntries.js)) {
129
128
  let noCachedCount = 0;
130
- for (let i = 0; i < groupedEntries.js.length; i++) {
131
- const [file, originalSource] = groupedEntries.js[i];
129
+ for (const element of groupedEntries.js) {
130
+ const [file, originalSource] = element;
132
131
  const cacheKey = removeExt(file);
133
132
  yield cache.process(
134
133
  cacheKey,
@@ -168,8 +167,8 @@ var UnifiedWebpackPluginV5 = class {
168
167
  }
169
168
  if (Array.isArray(groupedEntries.css)) {
170
169
  let noCachedCount = 0;
171
- for (let i = 0; i < groupedEntries.css.length; i++) {
172
- const [file, originalSource] = groupedEntries.css[i];
170
+ for (const element of groupedEntries.css) {
171
+ const [file, originalSource] = element;
173
172
  const rawSource = originalSource.source().toString();
174
173
  const hash = cache.computeHash(rawSource);
175
174
  const cacheKey = file;
@@ -2,12 +2,12 @@ import {
2
2
  createDebug
3
3
  } from "./chunk-75EWCRQW.mjs";
4
4
  import {
5
- getOptions
6
- } from "./chunk-IS6WLJ6U.mjs";
5
+ getCompilerContext
6
+ } from "./chunk-PCLP6Y32.mjs";
7
7
  import {
8
8
  __async,
9
9
  __spreadValues
10
- } from "./chunk-FSYVGTJO.mjs";
10
+ } from "./chunk-AXBFBHS2.mjs";
11
11
 
12
12
  // src/bundlers/gulp/index.ts
13
13
  import { Buffer } from "node:buffer";
@@ -15,10 +15,10 @@ import stream from "node:stream";
15
15
  var debug = createDebug();
16
16
  var Transform = stream.Transform;
17
17
  function createPlugins(options = {}) {
18
- const opts = getOptions(options);
19
- const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
18
+ const opts = getCompilerContext(options);
19
+ const { templateHandler, styleHandler, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
20
20
  let runtimeSet = /* @__PURE__ */ new Set();
21
- patch == null ? void 0 : patch();
21
+ twPatcher.patch();
22
22
  function transformWxss(options2 = {}) {
23
23
  return new Transform({
24
24
  objectMode: true,
@@ -3,21 +3,21 @@
3
3
  var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
4
4
 
5
5
 
6
- var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
6
+ var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
7
7
 
8
8
 
9
- var _chunkSLGPM54Rjs = require('./chunk-SLGPM54R.js');
9
+ var _chunkUDT6MZJ7js = require('./chunk-UDT6MZJ7.js');
10
10
 
11
11
 
12
12
  var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
13
13
 
14
14
 
15
- var _chunkR3QJNUYUjs = require('./chunk-R3QJNUYU.js');
15
+ var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.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 = _chunkSLGPM54Rjs.getOptions.call(void 0, options);
20
+ const opts = _chunkUDT6MZJ7js.getCompilerContext.call(void 0, options);
21
21
  const {
22
22
  disabled,
23
23
  onEnd,
@@ -26,7 +26,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
26
26
  onUpdate,
27
27
  templateHandler,
28
28
  styleHandler,
29
- patch,
30
29
  jsHandler,
31
30
  mainCssChunkMatcher,
32
31
  appType,
@@ -37,13 +36,13 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
37
36
  if (disabled) {
38
37
  return;
39
38
  }
40
- patch == null ? void 0 : patch();
39
+ twPatcher.patch();
41
40
  onLoad();
42
41
  return {
43
- name: _chunkEHEK77ROjs.vitePluginName,
42
+ name: _chunkN62XM3T3js.vitePluginName,
44
43
  enforce: "post",
45
44
  generateBundle(_opt, bundle) {
46
- return _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
45
+ return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
47
46
  debug("start");
48
47
  onStart();
49
48
  const entries = Object.entries(bundle);
@@ -53,8 +52,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
53
52
  debug("get runtimeSet, class count: %d", runtimeSet.size);
54
53
  if (Array.isArray(groupedEntries.html)) {
55
54
  let noCachedCount = 0;
56
- for (let i = 0; i < groupedEntries.html.length; i++) {
57
- const [file, originalSource] = groupedEntries.html[i];
55
+ for (const element of groupedEntries.html) {
56
+ const [file, originalSource] = element;
58
57
  const oldVal = originalSource.source.toString();
59
58
  const hash = cache.computeHash(oldVal);
60
59
  cache.calcHashValueChanged(file, hash);
@@ -69,7 +68,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
69
68
  return false;
70
69
  }
71
70
  },
72
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
71
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
73
72
  originalSource.source = yield templateHandler(oldVal, {
74
73
  runtimeSet
75
74
  });
@@ -87,8 +86,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
87
86
  }
88
87
  if (Array.isArray(groupedEntries.js)) {
89
88
  let noCachedCount = 0;
90
- for (let i = 0; i < groupedEntries.js.length; i++) {
91
- const [file, originalSource] = groupedEntries.js[i];
89
+ for (const element of groupedEntries.js) {
90
+ const [file, originalSource] = element;
92
91
  const rawSource = originalSource.code;
93
92
  const hash = cache.computeHash(rawSource);
94
93
  cache.calcHashValueChanged(file, hash);
@@ -103,7 +102,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
103
102
  return false;
104
103
  }
105
104
  },
106
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
105
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
107
106
  const mapFilename = `${file}.map`;
108
107
  const hasMap = Boolean(bundle[mapFilename]);
109
108
  const { code, map } = yield jsHandler(rawSource, runtimeSet, {
@@ -128,8 +127,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
128
127
  }
129
128
  if (Array.isArray(groupedEntries.css)) {
130
129
  let noCachedCount = 0;
131
- for (let i = 0; i < groupedEntries.css.length; i++) {
132
- const [file, originalSource] = groupedEntries.css[i];
130
+ for (const element of groupedEntries.css) {
131
+ const [file, originalSource] = element;
133
132
  const rawSource = originalSource.source.toString();
134
133
  const hash = cache.computeHash(rawSource);
135
134
  cache.calcHashValueChanged(file, hash);
@@ -144,7 +143,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
144
143
  return false;
145
144
  }
146
145
  },
147
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
146
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
148
147
  const { css } = yield styleHandler(rawSource, {
149
148
  isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
150
149
  });
@@ -3,11 +3,11 @@
3
3
  var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
4
4
 
5
5
 
6
- var _chunkSLGPM54Rjs = require('./chunk-SLGPM54R.js');
6
+ var _chunkUDT6MZJ7js = require('./chunk-UDT6MZJ7.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkR3QJNUYUjs = require('./chunk-R3QJNUYU.js');
10
+ var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
11
11
 
12
12
  // src/bundlers/gulp/index.ts
13
13
  var _buffer = require('buffer');
@@ -15,15 +15,15 @@ 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 = _chunkSLGPM54Rjs.getOptions.call(void 0, options);
19
- const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
18
+ const opts = _chunkUDT6MZJ7js.getCompilerContext.call(void 0, options);
19
+ const { templateHandler, styleHandler, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
20
20
  let runtimeSet = /* @__PURE__ */ new Set();
21
- patch == null ? void 0 : patch();
21
+ twPatcher.patch();
22
22
  function transformWxss(options2 = {}) {
23
23
  return new Transform({
24
24
  objectMode: true,
25
25
  transform(file, _encoding, callback) {
26
- return _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
26
+ return _chunk6FNC3XMIjs.__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
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
46
- const { css } = yield styleHandler(rawSource, _chunkR3QJNUYUjs.__spreadValues.call(void 0, {
45
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
46
+ const { css } = yield styleHandler(rawSource, _chunk6FNC3XMIjs.__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 _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
71
+ return _chunk6FNC3XMIjs.__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
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
88
+ () => _chunk6FNC3XMIjs.__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 _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
108
+ return _chunk6FNC3XMIjs.__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
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
126
- const code = yield templateHandler(rawSource, _chunkR3QJNUYUjs.__spreadValues.call(void 0, {
125
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
126
+ const code = yield templateHandler(rawSource, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {
127
127
  runtimeSet
128
128
  }, options2));
129
129
  file.contents = _buffer.Buffer.from(code);
@@ -3,17 +3,17 @@
3
3
  var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
4
4
 
5
5
 
6
- var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
6
+ var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
7
7
 
8
8
 
9
- var _chunkSLGPM54Rjs = require('./chunk-SLGPM54R.js');
9
+ var _chunkUDT6MZJ7js = require('./chunk-UDT6MZJ7.js');
10
10
 
11
11
 
12
12
 
13
13
  var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
14
14
 
15
15
 
16
- var _chunkR3QJNUYUjs = require('./chunk-R3QJNUYU.js');
16
+ var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
17
17
 
18
18
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
19
19
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
@@ -21,7 +21,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
21
21
  var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
22
22
  var UnifiedWebpackPluginV5 = class {
23
23
  constructor(options = {}) {
24
- this.options = _chunkSLGPM54Rjs.getOptions.call(void 0, options);
24
+ this.options = _chunkUDT6MZJ7js.getCompilerContext.call(void 0, options);
25
25
  this.appType = this.options.appType;
26
26
  }
27
27
  apply(compiler) {
@@ -33,7 +33,6 @@ var UnifiedWebpackPluginV5 = class {
33
33
  onEnd,
34
34
  onStart,
35
35
  styleHandler,
36
- patch,
37
36
  templateHandler,
38
37
  jsHandler,
39
38
  setMangleRuntimeSet,
@@ -44,7 +43,7 @@ var UnifiedWebpackPluginV5 = class {
44
43
  if (disabled) {
45
44
  return;
46
45
  }
47
- patch == null ? void 0 : patch();
46
+ twPatcher.patch();
48
47
  const { Compilation, sources, NormalModule } = compiler.webpack;
49
48
  const { ConcatSource, RawSource } = sources;
50
49
  function getClassSet() {
@@ -61,8 +60,8 @@ var UnifiedWebpackPluginV5 = class {
61
60
  ident: null,
62
61
  type: null
63
62
  };
64
- compiler.hooks.compilation.tap(_chunkEHEK77ROjs.pluginName, (compilation) => {
65
- NormalModule.getCompilationHooks(compilation).loader.tap(_chunkEHEK77ROjs.pluginName, (_loaderContext, module) => {
63
+ compiler.hooks.compilation.tap(_chunkN62XM3T3js.pluginName, (compilation) => {
64
+ NormalModule.getCompilationHooks(compilation).loader.tap(_chunkN62XM3T3js.pluginName, (_loaderContext, module) => {
66
65
  if (isExisted) {
67
66
  const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
68
67
  if (idx > -1) {
@@ -72,10 +71,10 @@ var UnifiedWebpackPluginV5 = class {
72
71
  });
73
72
  compilation.hooks.processAssets.tapPromise(
74
73
  {
75
- name: _chunkEHEK77ROjs.pluginName,
74
+ name: _chunkN62XM3T3js.pluginName,
76
75
  stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
77
76
  },
78
- (assets) => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
77
+ (assets) => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
79
78
  onStart();
80
79
  debug("start");
81
80
  for (const chunk of compilation.chunks) {
@@ -90,8 +89,8 @@ var UnifiedWebpackPluginV5 = class {
90
89
  debug("get runtimeSet, class count: %d", runtimeSet.size);
91
90
  if (Array.isArray(groupedEntries.html)) {
92
91
  let noCachedCount = 0;
93
- for (let i = 0; i < groupedEntries.html.length; i++) {
94
- const [file, originalSource] = groupedEntries.html[i];
92
+ for (const element of groupedEntries.html) {
93
+ const [file, originalSource] = element;
95
94
  const rawSource = originalSource.source().toString();
96
95
  const hash = cache.computeHash(rawSource);
97
96
  const cacheKey = file;
@@ -107,7 +106,7 @@ var UnifiedWebpackPluginV5 = class {
107
106
  return false;
108
107
  }
109
108
  },
110
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
109
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
111
110
  const wxml = yield templateHandler(rawSource, {
112
111
  runtimeSet
113
112
  });
@@ -127,8 +126,8 @@ var UnifiedWebpackPluginV5 = class {
127
126
  }
128
127
  if (Array.isArray(groupedEntries.js)) {
129
128
  let noCachedCount = 0;
130
- for (let i = 0; i < groupedEntries.js.length; i++) {
131
- const [file, originalSource] = groupedEntries.js[i];
129
+ for (const element of groupedEntries.js) {
130
+ const [file, originalSource] = element;
132
131
  const cacheKey = _chunk35CYTBPMjs.removeExt.call(void 0, file);
133
132
  yield cache.process(
134
133
  cacheKey,
@@ -141,7 +140,7 @@ var UnifiedWebpackPluginV5 = class {
141
140
  return false;
142
141
  }
143
142
  },
144
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
143
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
145
144
  const rawSource = originalSource.source().toString();
146
145
  const mapFilename = `${file}.map`;
147
146
  const hasMap = Boolean(assets[mapFilename]);
@@ -168,8 +167,8 @@ var UnifiedWebpackPluginV5 = class {
168
167
  }
169
168
  if (Array.isArray(groupedEntries.css)) {
170
169
  let noCachedCount = 0;
171
- for (let i = 0; i < groupedEntries.css.length; i++) {
172
- const [file, originalSource] = groupedEntries.css[i];
170
+ for (const element of groupedEntries.css) {
171
+ const [file, originalSource] = element;
173
172
  const rawSource = originalSource.source().toString();
174
173
  const hash = cache.computeHash(rawSource);
175
174
  const cacheKey = file;
@@ -185,7 +184,7 @@ var UnifiedWebpackPluginV5 = class {
185
184
  return false;
186
185
  }
187
186
  },
188
- () => _chunkR3QJNUYUjs.__async.call(void 0, this, null, function* () {
187
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
189
188
  const { css } = yield styleHandler(rawSource, {
190
189
  isMainChunk: mainCssChunkMatcher(file, this.appType)
191
190
  });
@@ -1,8 +1,8 @@
1
1
  // src/wxml/shared.ts
2
- import { escape, SimpleMappingChars2String } from "@weapp-core/escape";
2
+ import { escape, MappingChars2String } from "@weapp-core/escape";
3
3
  function replaceWxml(original, options = {
4
4
  keepEOL: false,
5
- escapeMap: SimpleMappingChars2String
5
+ escapeMap: MappingChars2String
6
6
  }) {
7
7
  const { keepEOL, escapeMap, mangleContext, ignoreHead } = options;
8
8
  let res = original;