unplugin-tailwindcss-mangle 4.0.2 → 4.0.4

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.
package/README.md CHANGED
@@ -7,6 +7,7 @@ It is recommended to read the documentation of [tailwindcss-patch](https://githu
7
7
  > Now Support `vite` and `webpack`
8
8
 
9
9
  - [unplugin-tailwindcss-mangle](#unplugin-tailwindcss-mangle)
10
+ - [Docs](#docs)
10
11
  - [Features](#features)
11
12
  - [Usage](#usage)
12
13
  - [1. Install Package](#1-install-package)
@@ -21,6 +22,10 @@ It is recommended to read the documentation of [tailwindcss-patch](https://githu
21
22
  - [Notice](#notice)
22
23
  - [Migration form v1 to v2](#migration-form-v1-to-v2)
23
24
 
25
+ ## Docs
26
+
27
+ [mangle.icebreaker.top](https://mangle.icebreaker.top)
28
+
24
29
  ## Features
25
30
 
26
31
  ```html
@@ -0,0 +1,495 @@
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; }// src/utils.ts
2
+ var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
3
+ var _process = require('process'); var _process2 = _interopRequireDefault(_process);
4
+ var _shared = require('@tailwindcss-mangle/shared');
5
+
6
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
7
+ var _lazyMatch = () => {
8
+ var __lib__ = (() => {
9
+ var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
10
+ for (var n in e) m(r, n, { get: e[n], enumerable: true });
11
+ }, H = (r, e, n, a) => {
12
+ if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
13
+ return r;
14
+ }, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
15
+ q(w, { default: () => re });
16
+ var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
17
+ const e = /* @__PURE__ */ new Map();
18
+ return (n) => {
19
+ const a = e.get(n);
20
+ if (a) return a;
21
+ const t = r(n);
22
+ return e.set(n, t), t;
23
+ };
24
+ }, rr = (r, e, n = {}) => {
25
+ const a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
26
+ if (v(e)(a) && a.index === r.length) return a.output;
27
+ throw new Error(`Failed to parse at index ${a.indexMax}`);
28
+ }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
29
+ const n = {};
30
+ for (const a of r) {
31
+ if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
32
+ const t = a.charCodeAt(0);
33
+ n[t] = true;
34
+ }
35
+ return (a) => {
36
+ const t = a.index, o = a.input;
37
+ for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
38
+ const u = a.index;
39
+ if (u > t) {
40
+ if (!h(e) && !a.options.silent) {
41
+ const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
42
+ h(c) || a.output.push(c);
43
+ }
44
+ a.indexMax = Math.max(a.indexMax, a.index);
45
+ }
46
+ return true;
47
+ };
48
+ }, nr = (r, e) => {
49
+ const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
50
+ return g((o) => {
51
+ t.lastIndex = o.index;
52
+ const u = t.exec(o.input);
53
+ if (u) {
54
+ if (!h(e) && !o.options.silent) {
55
+ const s = d(e) ? e(...u, o.input, String(o.index)) : e;
56
+ h(s) || o.output.push(s);
57
+ }
58
+ return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
59
+ } else return false;
60
+ });
61
+ }, ar = (r, e) => (n) => {
62
+ if (n.input.startsWith(r, n.index)) {
63
+ if (!h(e) && !n.options.silent) {
64
+ const t = d(e) ? e(r, n.input, String(n.index)) : e;
65
+ h(t) || n.output.push(t);
66
+ }
67
+ return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
68
+ } else return false;
69
+ }, C = (r, e, n, a) => {
70
+ const t = v(r);
71
+ return g(_(M((o) => {
72
+ let u = 0;
73
+ for (; u < n; ) {
74
+ const s = o.index;
75
+ if (!t(o) || (u += 1, o.index === s)) break;
76
+ }
77
+ return u >= e;
78
+ })));
79
+ }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
80
+ const n = r.map(v);
81
+ return g(_(M((a) => {
82
+ for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return false;
83
+ return true;
84
+ })));
85
+ }, l = (r, e) => {
86
+ const n = r.map(v);
87
+ return g(_((a) => {
88
+ for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return true;
89
+ return false;
90
+ }));
91
+ }, M = (r, e = false) => {
92
+ const n = v(r);
93
+ return (a) => {
94
+ const t = a.index, o = a.output.length, u = n(a);
95
+ return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
96
+ };
97
+ }, _ = (r, e) => {
98
+ const n = v(r);
99
+ return n;
100
+ }, g = /* @__PURE__ */ (() => {
101
+ let r = 0;
102
+ return (e) => {
103
+ const n = v(e), a = r += 1;
104
+ return (t) => {
105
+ var o;
106
+ if (t.options.memoization === false) return n(t);
107
+ const u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
108
+ if (c === false) return false;
109
+ if (W(c)) return t.index = c, true;
110
+ if (c) return t.index = c.index, _optionalChain([c, 'access', _2 => _2.output, 'optionalAccess', _3 => _3.length]) && t.output.push(...c.output), true;
111
+ {
112
+ const Z = t.output.length;
113
+ if (n(t)) {
114
+ const D = t.index, U = t.output.length;
115
+ if (U > Z) {
116
+ const ee = t.output.slice(Z, U);
117
+ s.set(u, { index: D, output: ee });
118
+ } else s.set(u, D);
119
+ return true;
120
+ } else return s.set(u, false), false;
121
+ }
122
+ };
123
+ };
124
+ })(), E = (r) => {
125
+ let e;
126
+ return (n) => (e || (e = v(r())), e(n));
127
+ }, v = Y((r) => {
128
+ if (d(r)) return Q(r) ? E(r) : r;
129
+ if (b(r) || X(r)) return i(r);
130
+ if (A(r)) return x(r);
131
+ if (K(r)) return l(Object.values(r));
132
+ throw new Error("Invalid rule");
133
+ }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
134
+ let e = "";
135
+ for (; r > 0; ) {
136
+ const n = (r - 1) % 26;
137
+ e = P[n] + e, r = Math.floor((r - 1) / 26);
138
+ }
139
+ return e;
140
+ }, O = (r) => {
141
+ let e = 0;
142
+ for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
143
+ return e;
144
+ }, S = (r, e) => {
145
+ if (e < r) return S(e, r);
146
+ const n = [];
147
+ for (; r <= e; ) n.push(r++);
148
+ return n;
149
+ }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
150
+ const e = {};
151
+ return (n) => _nullishCoalesce(e[n], () => ( (e[n] = r(n))));
152
+ }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
153
+ const n = Array.isArray(r) ? r : [r];
154
+ if (!n.length) return false;
155
+ const a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
156
+ return a.some((s) => s.test(o));
157
+ };
158
+ $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
159
+ var re = $;
160
+ return J(w);
161
+ })();
162
+ return __lib__.default || __lib__;
163
+ };
164
+ var _match;
165
+ var zeptomatch = (path, pattern) => {
166
+ if (!_match) {
167
+ _match = _lazyMatch();
168
+ _lazyMatch = null;
169
+ }
170
+ return _match(path, pattern);
171
+ };
172
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
173
+ function normalizeWindowsPath(input = "") {
174
+ if (!input) {
175
+ return input;
176
+ }
177
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
178
+ }
179
+ var _UNC_REGEX = /^[/\\]{2}/;
180
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
181
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
182
+ var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
183
+ var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
184
+ var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
185
+ var sep = "/";
186
+ var normalize = function(path) {
187
+ if (path.length === 0) {
188
+ return ".";
189
+ }
190
+ path = normalizeWindowsPath(path);
191
+ const isUNCPath = path.match(_UNC_REGEX);
192
+ const isPathAbsolute = isAbsolute(path);
193
+ const trailingSeparator = path[path.length - 1] === "/";
194
+ path = normalizeString(path, !isPathAbsolute);
195
+ if (path.length === 0) {
196
+ if (isPathAbsolute) {
197
+ return "/";
198
+ }
199
+ return trailingSeparator ? "./" : ".";
200
+ }
201
+ if (trailingSeparator) {
202
+ path += "/";
203
+ }
204
+ if (_DRIVE_LETTER_RE.test(path)) {
205
+ path += "/";
206
+ }
207
+ if (isUNCPath) {
208
+ if (!isPathAbsolute) {
209
+ return `//./${path}`;
210
+ }
211
+ return `//${path}`;
212
+ }
213
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
214
+ };
215
+ var join = function(...segments) {
216
+ let path = "";
217
+ for (const seg of segments) {
218
+ if (!seg) {
219
+ continue;
220
+ }
221
+ if (path.length > 0) {
222
+ const pathTrailing = path[path.length - 1] === "/";
223
+ const segLeading = seg[0] === "/";
224
+ const both = pathTrailing && segLeading;
225
+ if (both) {
226
+ path += seg.slice(1);
227
+ } else {
228
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
229
+ }
230
+ } else {
231
+ path += seg;
232
+ }
233
+ }
234
+ return normalize(path);
235
+ };
236
+ function cwd() {
237
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
238
+ return process.cwd().replace(/\\/g, "/");
239
+ }
240
+ return "/";
241
+ }
242
+ var resolve = function(...arguments_) {
243
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
244
+ let resolvedPath = "";
245
+ let resolvedAbsolute = false;
246
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
247
+ const path = index >= 0 ? arguments_[index] : cwd();
248
+ if (!path || path.length === 0) {
249
+ continue;
250
+ }
251
+ resolvedPath = `${path}/${resolvedPath}`;
252
+ resolvedAbsolute = isAbsolute(path);
253
+ }
254
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
255
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
256
+ return `/${resolvedPath}`;
257
+ }
258
+ return resolvedPath.length > 0 ? resolvedPath : ".";
259
+ };
260
+ function normalizeString(path, allowAboveRoot) {
261
+ let res = "";
262
+ let lastSegmentLength = 0;
263
+ let lastSlash = -1;
264
+ let dots = 0;
265
+ let char = null;
266
+ for (let index = 0; index <= path.length; ++index) {
267
+ if (index < path.length) {
268
+ char = path[index];
269
+ } else if (char === "/") {
270
+ break;
271
+ } else {
272
+ char = "/";
273
+ }
274
+ if (char === "/") {
275
+ if (lastSlash === index - 1 || dots === 1) ;
276
+ else if (dots === 2) {
277
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
278
+ if (res.length > 2) {
279
+ const lastSlashIndex = res.lastIndexOf("/");
280
+ if (lastSlashIndex === -1) {
281
+ res = "";
282
+ lastSegmentLength = 0;
283
+ } else {
284
+ res = res.slice(0, lastSlashIndex);
285
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
286
+ }
287
+ lastSlash = index;
288
+ dots = 0;
289
+ continue;
290
+ } else if (res.length > 0) {
291
+ res = "";
292
+ lastSegmentLength = 0;
293
+ lastSlash = index;
294
+ dots = 0;
295
+ continue;
296
+ }
297
+ }
298
+ if (allowAboveRoot) {
299
+ res += res.length > 0 ? "/.." : "..";
300
+ lastSegmentLength = 2;
301
+ }
302
+ } else {
303
+ if (res.length > 0) {
304
+ res += `/${path.slice(lastSlash + 1, index)}`;
305
+ } else {
306
+ res = path.slice(lastSlash + 1, index);
307
+ }
308
+ lastSegmentLength = index - lastSlash - 1;
309
+ }
310
+ lastSlash = index;
311
+ dots = 0;
312
+ } else if (char === "." && dots !== -1) {
313
+ ++dots;
314
+ } else {
315
+ dots = -1;
316
+ }
317
+ }
318
+ return res;
319
+ }
320
+ var isAbsolute = function(p) {
321
+ return _IS_ABSOLUTE_RE.test(p);
322
+ };
323
+ var toNamespacedPath = function(p) {
324
+ return normalizeWindowsPath(p);
325
+ };
326
+ var extname = function(p) {
327
+ if (p === "..") return "";
328
+ const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
329
+ return match && match[1] || "";
330
+ };
331
+ var relative = function(from, to) {
332
+ const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
333
+ const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
334
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
335
+ return _to.join("/");
336
+ }
337
+ const _fromCopy = [..._from];
338
+ for (const segment of _fromCopy) {
339
+ if (_to[0] !== segment) {
340
+ break;
341
+ }
342
+ _from.shift();
343
+ _to.shift();
344
+ }
345
+ return [..._from.map(() => ".."), ..._to].join("/");
346
+ };
347
+ var dirname = function(p) {
348
+ const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
349
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
350
+ segments[0] += "/";
351
+ }
352
+ return segments.join("/") || (isAbsolute(p) ? "/" : ".");
353
+ };
354
+ var format = function(p) {
355
+ const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
356
+ const segments = [p.root, p.dir, _nullishCoalesce(p.base, () => ( (_nullishCoalesce(p.name, () => ( ""))) + ext))].filter(
357
+ Boolean
358
+ );
359
+ return normalizeWindowsPath(
360
+ p.root ? resolve(...segments) : segments.join("/")
361
+ );
362
+ };
363
+ var basename = function(p, extension) {
364
+ const segments = normalizeWindowsPath(p).split("/");
365
+ let lastSegment = "";
366
+ for (let i = segments.length - 1; i >= 0; i--) {
367
+ const val = segments[i];
368
+ if (val) {
369
+ lastSegment = val;
370
+ break;
371
+ }
372
+ }
373
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
374
+ };
375
+ var parse = function(p) {
376
+ const root = _optionalChain([_PATH_ROOT_RE, 'access', _4 => _4.exec, 'call', _5 => _5(p), 'optionalAccess', _6 => _6[0], 'optionalAccess', _7 => _7.replace, 'call', _8 => _8(/\\/g, "/")]) || "";
377
+ const base = basename(p);
378
+ const extension = extname(base);
379
+ return {
380
+ root,
381
+ dir: dirname(p),
382
+ base,
383
+ ext: extension,
384
+ name: base.slice(0, base.length - extension.length)
385
+ };
386
+ };
387
+ var matchesGlob = (path, pattern) => {
388
+ return zeptomatch(pattern, normalize(path));
389
+ };
390
+ var _path = {
391
+ __proto__: null,
392
+ basename,
393
+ dirname,
394
+ extname,
395
+ format,
396
+ isAbsolute,
397
+ join,
398
+ matchesGlob,
399
+ normalize,
400
+ normalizeString,
401
+ parse,
402
+ relative,
403
+ resolve,
404
+ sep,
405
+ toNamespacedPath
406
+ };
407
+
408
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
409
+ var delimiter = /* @__PURE__ */ (() => _optionalChain([globalThis, 'access', _9 => _9.process, 'optionalAccess', _10 => _10.platform]) === "win32" ? ";" : ":")();
410
+ var _platforms = { posix: void 0, win32: void 0 };
411
+ var mix = (del = delimiter) => {
412
+ return new Proxy(_path, {
413
+ get(_, prop) {
414
+ if (prop === "delimiter") return del;
415
+ if (prop === "posix") return posix;
416
+ if (prop === "win32") return win32;
417
+ return _platforms[prop] || _path[prop];
418
+ }
419
+ });
420
+ };
421
+ var posix = /* @__PURE__ */ mix(":");
422
+ var win32 = /* @__PURE__ */ mix(";");
423
+
424
+ // src/constants.ts
425
+ var pluginName = "unplugin-tailwindcss-mangle";
426
+
427
+ // src/utils.ts
428
+
429
+ function escapeStringRegexp(str) {
430
+ if (typeof str !== "string") {
431
+ throw new TypeError("Expected a string");
432
+ }
433
+ return str.replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&").replaceAll("-", "\\x2d");
434
+ }
435
+ function getGroupedEntries(entries, options = {
436
+ cssMatcher(file) {
437
+ return /\.css$/.test(file);
438
+ },
439
+ htmlMatcher(file) {
440
+ return /\.html?$/.test(file);
441
+ },
442
+ jsMatcher(file) {
443
+ return /\.[cm]?js$/.test(file);
444
+ }
445
+ }) {
446
+ const { cssMatcher, htmlMatcher, jsMatcher } = options;
447
+ const groupedEntries = _shared.groupBy.call(void 0, entries, ([file]) => {
448
+ if (cssMatcher(file)) {
449
+ return "css";
450
+ } else if (htmlMatcher(file)) {
451
+ return "html";
452
+ } else if (jsMatcher(file)) {
453
+ return "js";
454
+ } else {
455
+ return "other";
456
+ }
457
+ });
458
+ if (!groupedEntries.css) {
459
+ groupedEntries.css = [];
460
+ }
461
+ if (!groupedEntries.html) {
462
+ groupedEntries.html = [];
463
+ }
464
+ if (!groupedEntries.js) {
465
+ groupedEntries.js = [];
466
+ }
467
+ if (!groupedEntries.other) {
468
+ groupedEntries.other = [];
469
+ }
470
+ return groupedEntries;
471
+ }
472
+ function getCacheDir(basedir = _process2.default.cwd()) {
473
+ return posix.resolve(basedir, "node_modules/.cache", pluginName);
474
+ }
475
+ async function ensureDir(p) {
476
+ try {
477
+ await _promises2.default.access(p);
478
+ } catch (e2) {
479
+ await _promises2.default.mkdir(p, {
480
+ recursive: true
481
+ });
482
+ }
483
+ }
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+ exports.posix = posix; exports.pluginName = pluginName; exports.escapeStringRegexp = escapeStringRegexp; exports.getGroupedEntries = getGroupedEntries; exports.getCacheDir = getCacheDir; exports.ensureDir = ensureDir; exports.defaultMangleClassFilter = _shared.defaultMangleClassFilter; exports.isMap = _shared.isMap; exports.isRegexp = _shared.isRegexp;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  __dirname,
3
3
  getGroupedEntries,
4
- path,
5
- pluginName
6
- } from "./chunk-XHKKB7IA.js";
4
+ pluginName,
5
+ posix
6
+ } from "./chunk-DRXELMFM.js";
7
7
 
8
8
  // src/core/plugin.ts
9
9
  import { createUnplugin } from "unplugin";
@@ -12,7 +12,7 @@ import { createUnplugin } from "unplugin";
12
12
  import { createFilter } from "@rollup/pluginutils";
13
13
  import { Context, cssHandler, htmlHandler, jsHandler } from "@tailwindcss-mangle/core";
14
14
  import { isCSSRequest } from "is-css-request";
15
- var WEBPACK_LOADER = path.resolve(__dirname, false ? "../../dist/core/loader.cjs" : "core/loader.cjs");
15
+ var WEBPACK_LOADER = posix.resolve(__dirname, false ? "../../dist/core/loader.cjs" : "core/loader.cjs");
16
16
  var factory = (options) => {
17
17
  const ctx = new Context();
18
18
  let filter = (_id) => true;