weapp-tailwindcss 2.11.2 → 2.11.3

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 (45) hide show
  1. package/dist/cli.js +5 -5
  2. package/dist/cli.mjs +5 -5
  3. package/dist/core.js +5 -5
  4. package/dist/core.mjs +5 -5
  5. package/dist/css-macro/index.js +3 -3
  6. package/dist/css-macro/index.mjs +2 -2
  7. package/dist/css-macro/postcss.js +1 -1
  8. package/dist/css-macro/postcss.mjs +1 -1
  9. package/dist/defaults.js +1 -1
  10. package/dist/defaults.mjs +1 -1
  11. package/dist/{defu-NLkZUlr9.mjs → defu-D2_bzAv0.mjs} +19 -9
  12. package/dist/{defu-VMJMz2AB.js → defu-JkbfvVKI.js} +19 -9
  13. package/dist/gulp.js +8 -69
  14. package/dist/gulp.mjs +7 -68
  15. package/dist/index-C70Rgk3g.js +142 -0
  16. package/dist/{index-z25r_Htj.js → index-CKXO21Qe.js} +1 -1
  17. package/dist/index-D3TDwy2Y.mjs +140 -0
  18. package/dist/index-De0cmOEK.js +70 -0
  19. package/dist/index-QLyv-Fcp.mjs +64 -0
  20. package/dist/index.js +12 -12
  21. package/dist/index.mjs +9 -9
  22. package/dist/{options-QwNnkDpt.mjs → options-B5UOFsZN.mjs} +24 -36
  23. package/dist/{options-GnoWW1lR.js → options-BAFFNEBI.js} +25 -37
  24. package/dist/{postcss-Et8j4ugT.js → plugin-Bxt3oO75.js} +2 -2
  25. package/dist/{postcss-W8i3cl5I.mjs → plugin-Du3zrk3S.mjs} +1 -1
  26. package/dist/postcss.js +5 -5
  27. package/dist/postcss.mjs +2 -2
  28. package/dist/replace.js +6 -6
  29. package/dist/replace.mjs +1 -1
  30. package/dist/types.d.ts +2 -1
  31. package/dist/v5-Crbh5I-S.js +187 -0
  32. package/dist/v5-V8LlDF1a.mjs +180 -0
  33. package/dist/vite.js +10 -141
  34. package/dist/vite.mjs +8 -143
  35. package/dist/weapp-tw-runtime-loader.js +1 -1
  36. package/dist/webpack.js +11 -185
  37. package/dist/webpack.mjs +10 -183
  38. package/package.json +53 -52
  39. /package/dist/{constants-ol1NPf7z.mjs → constants-CcqTvLgQ.mjs} +0 -0
  40. /package/dist/{constants-EVxkHOXL.js → constants-D-YMDg7M.js} +0 -0
  41. /package/dist/{defaults-dz6xGhOP.mjs → defaults-DMBtD8TO.mjs} +0 -0
  42. /package/dist/{defaults-0O-zKoXE.js → defaults-qX2VLo8u.js} +0 -0
  43. /package/dist/{index-06BoOZig.mjs → index-CLxBL7MC.mjs} +0 -0
  44. /package/dist/{shared-S0v7ZvWs.mjs → shared-D4ZM_mI-.mjs} +0 -0
  45. /package/dist/{shared-nXoJWFdz.js → shared-DtRIj-D_.js} +0 -0
package/dist/cli.js CHANGED
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-GnoWW1lR.js');
3
+ var options = require('./options-BAFFNEBI.js');
4
4
  require('micromatch');
5
5
  require('magic-string');
6
6
  require('./replace.js');
7
7
  require('@weapp-core/escape');
8
8
  require('@ast-core/escape');
9
- require('./shared-nXoJWFdz.js');
9
+ require('./shared-DtRIj-D_.js');
10
10
  require('@weapp-core/regex');
11
11
  require('@babel/generator');
12
12
  require('@babel/parser');
13
13
  require('@babel/traverse');
14
- require('./defu-VMJMz2AB.js');
15
- require('./defaults-0O-zKoXE.js');
14
+ require('./defu-JkbfvVKI.js');
15
+ require('./defaults-qX2VLo8u.js');
16
16
  require('@babel/types');
17
17
  require('htmlparser2');
18
18
  require('postcss');
19
- require('./postcss-Et8j4ugT.js');
19
+ require('./plugin-Bxt3oO75.js');
20
20
  require('postcss-selector-parser');
21
21
  require('@csstools/postcss-is-pseudo-class');
22
22
  require('node:path');
package/dist/cli.mjs CHANGED
@@ -1,20 +1,20 @@
1
- import { g as getOptions, c as createPatch } from './options-QwNnkDpt.mjs';
1
+ import { g as getOptions, a as createPatch } from './options-B5UOFsZN.mjs';
2
2
  import 'micromatch';
3
3
  import 'magic-string';
4
4
  import './replace.mjs';
5
5
  import '@weapp-core/escape';
6
6
  import '@ast-core/escape';
7
- import './shared-S0v7ZvWs.mjs';
7
+ import './shared-D4ZM_mI-.mjs';
8
8
  import '@weapp-core/regex';
9
9
  import '@babel/generator';
10
10
  import '@babel/parser';
11
11
  import '@babel/traverse';
12
- import './defu-NLkZUlr9.mjs';
13
- import './defaults-dz6xGhOP.mjs';
12
+ import './defu-D2_bzAv0.mjs';
13
+ import './defaults-DMBtD8TO.mjs';
14
14
  import '@babel/types';
15
15
  import 'htmlparser2';
16
16
  import 'postcss';
17
- import './postcss-W8i3cl5I.mjs';
17
+ import './plugin-Du3zrk3S.mjs';
18
18
  import 'postcss-selector-parser';
19
19
  import '@csstools/postcss-is-pseudo-class';
20
20
  import 'node:path';
package/dist/core.js CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-GnoWW1lR.js');
5
+ var options = require('./options-BAFFNEBI.js');
6
6
  require('micromatch');
7
7
  require('magic-string');
8
8
  require('./replace.js');
9
9
  require('@weapp-core/escape');
10
10
  require('@ast-core/escape');
11
- require('./shared-nXoJWFdz.js');
11
+ require('./shared-DtRIj-D_.js');
12
12
  require('@weapp-core/regex');
13
13
  require('@babel/generator');
14
14
  require('@babel/parser');
15
15
  require('@babel/traverse');
16
- require('./defu-VMJMz2AB.js');
17
- require('./defaults-0O-zKoXE.js');
16
+ require('./defu-JkbfvVKI.js');
17
+ require('./defaults-qX2VLo8u.js');
18
18
  require('@babel/types');
19
19
  require('htmlparser2');
20
20
  require('postcss');
21
- require('./postcss-Et8j4ugT.js');
21
+ require('./plugin-Bxt3oO75.js');
22
22
  require('postcss-selector-parser');
23
23
  require('@csstools/postcss-is-pseudo-class');
24
24
  require('node:path');
package/dist/core.mjs CHANGED
@@ -1,20 +1,20 @@
1
- import { g as getOptions, a as createTailwindcssPatcher, _ as __awaiter } from './options-QwNnkDpt.mjs';
1
+ import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-B5UOFsZN.mjs';
2
2
  import 'micromatch';
3
3
  import 'magic-string';
4
4
  import './replace.mjs';
5
5
  import '@weapp-core/escape';
6
6
  import '@ast-core/escape';
7
- import './shared-S0v7ZvWs.mjs';
7
+ import './shared-D4ZM_mI-.mjs';
8
8
  import '@weapp-core/regex';
9
9
  import '@babel/generator';
10
10
  import '@babel/parser';
11
11
  import '@babel/traverse';
12
- import './defu-NLkZUlr9.mjs';
13
- import './defaults-dz6xGhOP.mjs';
12
+ import './defu-D2_bzAv0.mjs';
13
+ import './defaults-DMBtD8TO.mjs';
14
14
  import '@babel/types';
15
15
  import 'htmlparser2';
16
16
  import 'postcss';
17
- import './postcss-W8i3cl5I.mjs';
17
+ import './plugin-Du3zrk3S.mjs';
18
18
  import 'postcss-selector-parser';
19
19
  import '@csstools/postcss-is-pseudo-class';
20
20
  import 'node:path';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var plugin = require('tailwindcss/plugin');
4
- var constants = require('../constants-EVxkHOXL.js');
5
- var defu = require('../defu-VMJMz2AB.js');
4
+ var constants = require('../constants-D-YMDg7M.js');
5
+ var defu = require('../defu-JkbfvVKI.js');
6
6
 
7
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
8
 
9
9
  var plugin__default = /*#__PURE__*/_interopDefaultCompat(plugin);
10
10
 
@@ -1,6 +1,6 @@
1
1
  import plugin from 'tailwindcss/plugin';
2
- import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-ol1NPf7z.mjs';
3
- import { d as defu } from '../defu-NLkZUlr9.mjs';
2
+ import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-CcqTvLgQ.mjs';
3
+ import { d as defu } from '../defu-D2_bzAv0.mjs';
4
4
 
5
5
  var index = plugin.withOptions((options) => {
6
6
  const { dynamic: dynamicMode, variantsMap } = defu(options, {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var constants = require('../constants-EVxkHOXL.js');
3
+ var constants = require('../constants-D-YMDg7M.js');
4
4
 
5
5
  const creator = () => {
6
6
  return {
@@ -1,4 +1,4 @@
1
- import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-ol1NPf7z.mjs';
1
+ import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-CcqTvLgQ.mjs';
2
2
 
3
3
  const creator = () => {
4
4
  return {
package/dist/defaults.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var defaults = require('./defaults-0O-zKoXE.js');
5
+ var defaults = require('./defaults-qX2VLo8u.js');
6
6
  require('@weapp-core/escape');
7
7
  require('@ast-core/escape');
8
8
 
package/dist/defaults.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { d as defaultOptions } from './defaults-dz6xGhOP.mjs';
1
+ export { d as defaultOptions } from './defaults-DMBtD8TO.mjs';
2
2
  import '@weapp-core/escape';
3
3
  import '@ast-core/escape';
@@ -1,5 +1,22 @@
1
+ function isPlainObject(value) {
2
+ if (value === null || typeof value !== "object") {
3
+ return false;
4
+ }
5
+ const prototype = Object.getPrototypeOf(value);
6
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
7
+ return false;
8
+ }
9
+ if (Symbol.iterator in value) {
10
+ return false;
11
+ }
12
+ if (Symbol.toStringTag in value) {
13
+ return Object.prototype.toString.call(value) === "[object Module]";
14
+ }
15
+ return true;
16
+ }
17
+
1
18
  function _defu(baseObject, defaults, namespace = ".", merger) {
2
- if (!_isPlainObject(defaults)) {
19
+ if (!isPlainObject(defaults)) {
3
20
  return _defu(baseObject, {}, namespace, merger);
4
21
  }
5
22
  const object = Object.assign({}, defaults);
@@ -16,7 +33,7 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
16
33
  }
17
34
  if (Array.isArray(value) && Array.isArray(object[key])) {
18
35
  object[key] = [...value, ...object[key]];
19
- } else if (_isPlainObject(value) && _isPlainObject(object[key])) {
36
+ } else if (isPlainObject(value) && isPlainObject(object[key])) {
20
37
  object[key] = _defu(
21
38
  value,
22
39
  object[key],
@@ -29,13 +46,6 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
29
46
  }
30
47
  return object;
31
48
  }
32
- function _isPlainObject(value) {
33
- if (value === null || typeof value !== "object") {
34
- return false;
35
- }
36
- const prototype = Object.getPrototypeOf(value);
37
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
38
- }
39
49
  function createDefu(merger) {
40
50
  return (...arguments_) => (
41
51
  // eslint-disable-next-line unicorn/no-array-reduce
@@ -1,7 +1,24 @@
1
1
  'use strict';
2
2
 
3
+ function isPlainObject(value) {
4
+ if (value === null || typeof value !== "object") {
5
+ return false;
6
+ }
7
+ const prototype = Object.getPrototypeOf(value);
8
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
9
+ return false;
10
+ }
11
+ if (Symbol.iterator in value) {
12
+ return false;
13
+ }
14
+ if (Symbol.toStringTag in value) {
15
+ return Object.prototype.toString.call(value) === "[object Module]";
16
+ }
17
+ return true;
18
+ }
19
+
3
20
  function _defu(baseObject, defaults, namespace = ".", merger) {
4
- if (!_isPlainObject(defaults)) {
21
+ if (!isPlainObject(defaults)) {
5
22
  return _defu(baseObject, {}, namespace, merger);
6
23
  }
7
24
  const object = Object.assign({}, defaults);
@@ -18,7 +35,7 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
18
35
  }
19
36
  if (Array.isArray(value) && Array.isArray(object[key])) {
20
37
  object[key] = [...value, ...object[key]];
21
- } else if (_isPlainObject(value) && _isPlainObject(object[key])) {
38
+ } else if (isPlainObject(value) && isPlainObject(object[key])) {
22
39
  object[key] = _defu(
23
40
  value,
24
41
  object[key],
@@ -31,13 +48,6 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
31
48
  }
32
49
  return object;
33
50
  }
34
- function _isPlainObject(value) {
35
- if (value === null || typeof value !== "object") {
36
- return false;
37
- }
38
- const prototype = Object.getPrototypeOf(value);
39
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
40
- }
41
51
  function createDefu(merger) {
42
52
  return (...arguments_) => (
43
53
  // eslint-disable-next-line unicorn/no-array-reduce
package/dist/gulp.js CHANGED
@@ -2,24 +2,24 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-GnoWW1lR.js');
6
- var stream = require('node:stream');
5
+ var index = require('./index-De0cmOEK.js');
6
+ require('./options-BAFFNEBI.js');
7
7
  require('micromatch');
8
8
  require('magic-string');
9
9
  require('./replace.js');
10
10
  require('@weapp-core/escape');
11
11
  require('@ast-core/escape');
12
- require('./shared-nXoJWFdz.js');
12
+ require('./shared-DtRIj-D_.js');
13
13
  require('@weapp-core/regex');
14
14
  require('@babel/generator');
15
15
  require('@babel/parser');
16
16
  require('@babel/traverse');
17
- require('./defu-VMJMz2AB.js');
18
- require('./defaults-0O-zKoXE.js');
17
+ require('./defu-JkbfvVKI.js');
18
+ require('./defaults-qX2VLo8u.js');
19
19
  require('@babel/types');
20
20
  require('htmlparser2');
21
21
  require('postcss');
22
- require('./postcss-Et8j4ugT.js');
22
+ require('./plugin-Bxt3oO75.js');
23
23
  require('postcss-selector-parser');
24
24
  require('@csstools/postcss-is-pseudo-class');
25
25
  require('node:path');
@@ -29,69 +29,8 @@ require('tailwindcss-patch');
29
29
  require('@tailwindcss-mangle/shared');
30
30
  require('lru-cache');
31
31
  require('md5');
32
+ require('node:stream');
32
33
 
33
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
34
34
 
35
- var stream__default = /*#__PURE__*/_interopDefaultCompat(stream);
36
35
 
37
- const Transform = stream__default["default"].Transform;
38
- function createPlugins(options$1 = {}) {
39
- const opts = options.getOptions(options$1);
40
- const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir } = opts;
41
- let runtimeSet = new Set();
42
- patch === null || patch === void 0 ? void 0 : patch();
43
- const twPatcher = options.createTailwindcssPatcher();
44
- function transformWxss() {
45
- const transformStream = new Transform({ objectMode: true });
46
- transformStream._transform = function (file, encoding, callback) {
47
- return options.__awaiter(this, void 0, void 0, function* () {
48
- runtimeSet = twPatcher.getClassSet({
49
- basedir: tailwindcssBasedir
50
- });
51
- setMangleRuntimeSet(runtimeSet);
52
- const error = null;
53
- if (file.contents) {
54
- const code = yield styleHandler(file.contents.toString(), {
55
- isMainChunk: true
56
- });
57
- file.contents = Buffer.from(code);
58
- }
59
- callback(error, file);
60
- });
61
- };
62
- return transformStream;
63
- }
64
- function transformJs() {
65
- const transformStream = new Transform({ objectMode: true });
66
- transformStream._transform = function (file, encoding, callback) {
67
- const error = null;
68
- if (file.contents) {
69
- const { code } = jsHandler(file.contents.toString(), runtimeSet);
70
- file.contents = Buffer.from(code);
71
- }
72
- callback(error, file);
73
- };
74
- return transformStream;
75
- }
76
- function transformWxml() {
77
- const transformStream = new Transform({ objectMode: true });
78
- transformStream._transform = function (file, encoding, callback) {
79
- const error = null;
80
- if (file.contents) {
81
- const code = templateHandler(file.contents.toString(), {
82
- runtimeSet
83
- });
84
- file.contents = Buffer.from(code);
85
- }
86
- callback(error, file);
87
- };
88
- return transformStream;
89
- }
90
- return {
91
- transformWxss,
92
- transformWxml,
93
- transformJs
94
- };
95
- }
96
-
97
- exports.createPlugins = createPlugins;
36
+ exports.createPlugins = index.createPlugins;
package/dist/gulp.mjs CHANGED
@@ -1,21 +1,21 @@
1
- import { g as getOptions, a as createTailwindcssPatcher, _ as __awaiter } from './options-QwNnkDpt.mjs';
2
- import stream from 'node:stream';
1
+ export { c as createPlugins } from './index-QLyv-Fcp.mjs';
2
+ import './options-B5UOFsZN.mjs';
3
3
  import 'micromatch';
4
4
  import 'magic-string';
5
5
  import './replace.mjs';
6
6
  import '@weapp-core/escape';
7
7
  import '@ast-core/escape';
8
- import './shared-S0v7ZvWs.mjs';
8
+ import './shared-D4ZM_mI-.mjs';
9
9
  import '@weapp-core/regex';
10
10
  import '@babel/generator';
11
11
  import '@babel/parser';
12
12
  import '@babel/traverse';
13
- import './defu-NLkZUlr9.mjs';
14
- import './defaults-dz6xGhOP.mjs';
13
+ import './defu-D2_bzAv0.mjs';
14
+ import './defaults-DMBtD8TO.mjs';
15
15
  import '@babel/types';
16
16
  import 'htmlparser2';
17
17
  import 'postcss';
18
- import './postcss-W8i3cl5I.mjs';
18
+ import './plugin-Du3zrk3S.mjs';
19
19
  import 'postcss-selector-parser';
20
20
  import '@csstools/postcss-is-pseudo-class';
21
21
  import 'node:path';
@@ -25,65 +25,4 @@ import 'tailwindcss-patch';
25
25
  import '@tailwindcss-mangle/shared';
26
26
  import 'lru-cache';
27
27
  import 'md5';
28
-
29
- const Transform = stream.Transform;
30
- function createPlugins(options = {}) {
31
- const opts = getOptions(options);
32
- const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir } = opts;
33
- let runtimeSet = new Set();
34
- patch === null || patch === void 0 ? void 0 : patch();
35
- const twPatcher = createTailwindcssPatcher();
36
- function transformWxss() {
37
- const transformStream = new Transform({ objectMode: true });
38
- transformStream._transform = function (file, encoding, callback) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- runtimeSet = twPatcher.getClassSet({
41
- basedir: tailwindcssBasedir
42
- });
43
- setMangleRuntimeSet(runtimeSet);
44
- const error = null;
45
- if (file.contents) {
46
- const code = yield styleHandler(file.contents.toString(), {
47
- isMainChunk: true
48
- });
49
- file.contents = Buffer.from(code);
50
- }
51
- callback(error, file);
52
- });
53
- };
54
- return transformStream;
55
- }
56
- function transformJs() {
57
- const transformStream = new Transform({ objectMode: true });
58
- transformStream._transform = function (file, encoding, callback) {
59
- const error = null;
60
- if (file.contents) {
61
- const { code } = jsHandler(file.contents.toString(), runtimeSet);
62
- file.contents = Buffer.from(code);
63
- }
64
- callback(error, file);
65
- };
66
- return transformStream;
67
- }
68
- function transformWxml() {
69
- const transformStream = new Transform({ objectMode: true });
70
- transformStream._transform = function (file, encoding, callback) {
71
- const error = null;
72
- if (file.contents) {
73
- const code = templateHandler(file.contents.toString(), {
74
- runtimeSet
75
- });
76
- file.contents = Buffer.from(code);
77
- }
78
- callback(error, file);
79
- };
80
- return transformStream;
81
- }
82
- return {
83
- transformWxss,
84
- transformWxml,
85
- transformJs
86
- };
87
- }
88
-
89
- export { createPlugins };
28
+ import 'node:stream';
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+
3
+ var options = require('./options-BAFFNEBI.js');
4
+ var plugin = require('./plugin-Bxt3oO75.js');
5
+ var defaults = require('./defaults-qX2VLo8u.js');
6
+ var index = require('./index-CKXO21Qe.js');
7
+
8
+ const debug = index.createDebug('generateBundle: ');
9
+ function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
10
+ if (options$1.customReplaceDictionary === undefined) {
11
+ options$1.customReplaceDictionary = 'simple';
12
+ }
13
+ const opts = options.getOptions(options$1);
14
+ const { disabled, onEnd, onLoad, onStart, onUpdate, templateHandler, styleHandler, patch, jsHandler, mainCssChunkMatcher, appType, setMangleRuntimeSet, cache, tailwindcssBasedir } = opts;
15
+ if (disabled) {
16
+ return;
17
+ }
18
+ patch === null || patch === void 0 ? void 0 : patch();
19
+ const twPatcher = options.createTailwindcssPatcher();
20
+ onLoad();
21
+ return {
22
+ name: plugin.vitePluginName,
23
+ enforce: 'post',
24
+ generateBundle(opt, bundle) {
25
+ return options.__awaiter(this, void 0, void 0, function* () {
26
+ debug('start');
27
+ onStart();
28
+ const entries = Object.entries(bundle);
29
+ const groupedEntries = defaults.getGroupedEntries(entries, opts);
30
+ const runtimeSet = twPatcher.getClassSet({
31
+ basedir: tailwindcssBasedir
32
+ });
33
+ setMangleRuntimeSet(runtimeSet);
34
+ debug('get runtimeSet, class count: %d', runtimeSet.size);
35
+ if (Array.isArray(groupedEntries.html)) {
36
+ let noCachedCount = 0;
37
+ for (let i = 0; i < groupedEntries.html.length; i++) {
38
+ const [file, originalSource] = groupedEntries.html[i];
39
+ const oldVal = originalSource.source.toString();
40
+ const hash = cache.computeHash(oldVal);
41
+ cache.calcHashValueChanged(file, hash);
42
+ yield cache.process(file, () => {
43
+ const source = cache.get(file);
44
+ if (source) {
45
+ originalSource.source = source;
46
+ debug('html cache hit: %s', file);
47
+ }
48
+ else {
49
+ return false;
50
+ }
51
+ }, () => {
52
+ originalSource.source = templateHandler(oldVal, {
53
+ runtimeSet
54
+ });
55
+ onUpdate(file, oldVal, originalSource.source);
56
+ debug('html handle: %s', file);
57
+ noCachedCount++;
58
+ return {
59
+ key: file,
60
+ source: originalSource.source
61
+ };
62
+ });
63
+ }
64
+ debug('html handle finish, total: %d, no-cached: %d', groupedEntries.html.length, noCachedCount);
65
+ }
66
+ if (Array.isArray(groupedEntries.js)) {
67
+ let noCachedCount = 0;
68
+ for (let i = 0; i < groupedEntries.js.length; i++) {
69
+ const [file, originalSource] = groupedEntries.js[i];
70
+ const rawSource = originalSource.code;
71
+ const hash = cache.computeHash(rawSource);
72
+ cache.calcHashValueChanged(file, hash);
73
+ yield cache.process(file, () => {
74
+ const source = cache.get(file);
75
+ if (source) {
76
+ originalSource.code = source;
77
+ debug('js cache hit: %s', file);
78
+ }
79
+ else {
80
+ return false;
81
+ }
82
+ }, () => {
83
+ const mapFilename = file + '.map';
84
+ const hasMap = Boolean(bundle[mapFilename]);
85
+ const { code, map } = jsHandler(rawSource, runtimeSet, {
86
+ generateMap: hasMap
87
+ });
88
+ originalSource.code = code;
89
+ onUpdate(file, rawSource, code);
90
+ debug('js handle: %s', file);
91
+ noCachedCount++;
92
+ if (hasMap && map) {
93
+ bundle[mapFilename].source = map.toString();
94
+ }
95
+ return {
96
+ key: file,
97
+ source: code
98
+ };
99
+ });
100
+ }
101
+ debug('js handle finish, total: %d, no-cached: %d', groupedEntries.js.length, noCachedCount);
102
+ }
103
+ if (Array.isArray(groupedEntries.css)) {
104
+ let noCachedCount = 0;
105
+ for (let i = 0; i < groupedEntries.css.length; i++) {
106
+ const [file, originalSource] = groupedEntries.css[i];
107
+ const rawSource = originalSource.source.toString();
108
+ const hash = cache.computeHash(rawSource);
109
+ cache.calcHashValueChanged(file, hash);
110
+ yield cache.process(file, () => {
111
+ const source = cache.get(file);
112
+ if (source) {
113
+ originalSource.source = source;
114
+ debug('css cache hit: %s', file);
115
+ }
116
+ else {
117
+ return false;
118
+ }
119
+ }, () => options.__awaiter(this, void 0, void 0, function* () {
120
+ const css = yield styleHandler(rawSource, {
121
+ isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
122
+ });
123
+ originalSource.source = css;
124
+ onUpdate(file, rawSource, css);
125
+ debug('css handle: %s', file);
126
+ noCachedCount++;
127
+ return {
128
+ key: file,
129
+ source: css
130
+ };
131
+ }));
132
+ }
133
+ debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
134
+ }
135
+ onEnd();
136
+ debug('end');
137
+ });
138
+ }
139
+ };
140
+ }
141
+
142
+ exports.UnifiedViteWeappTailwindcssPlugin = UnifiedViteWeappTailwindcssPlugin;
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _createDebug = require('debug');
4
4
 
5
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
5
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
6
6
 
7
7
  var _createDebug__default = /*#__PURE__*/_interopDefaultCompat(_createDebug);
8
8