unplugin-tailwindcss-mangle 4.0.1 → 4.0.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.
- package/README.md +5 -0
- package/dist/chunk-BZZ6FFT4.cjs +495 -0
- package/dist/{chunk-DLPKB44Y.js → chunk-CI6RSKGG.js} +4 -4
- package/dist/chunk-DRXELMFM.js +503 -0
- package/dist/{chunk-QSSGNNXY.cjs → chunk-YFLTUCKG.cjs} +10 -10
- package/dist/esbuild.cjs +3 -3
- package/dist/esbuild.js +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/dist/nuxt.cjs +4 -4
- package/dist/nuxt.js +2 -2
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.js +2 -2
- package/dist/utils.cjs +2 -2
- package/dist/utils.js +1 -1
- package/dist/vite.cjs +3 -3
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +3 -3
- package/dist/webpack.js +2 -2
- package/package.json +6 -6
- package/dist/chunk-QJCZGHDW.cjs +0 -297
- package/dist/chunk-SQYX773M.js +0 -305
package/dist/utils.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkBZZ6FFT4cjs = require('./chunk-BZZ6FFT4.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -15,4 +15,4 @@ var _chunkQJCZGHDWcjs = require('./chunk-QJCZGHDW.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.defaultMangleClassFilter =
|
|
18
|
+
exports.defaultMangleClassFilter = _chunkBZZ6FFT4cjs.defaultMangleClassFilter; exports.ensureDir = _chunkBZZ6FFT4cjs.ensureDir; exports.escapeStringRegexp = _chunkBZZ6FFT4cjs.escapeStringRegexp; exports.getCacheDir = _chunkBZZ6FFT4cjs.getCacheDir; exports.getGroupedEntries = _chunkBZZ6FFT4cjs.getGroupedEntries; exports.isMap = _chunkBZZ6FFT4cjs.isMap; exports.isRegexp = _chunkBZZ6FFT4cjs.isRegexp;
|
package/dist/utils.js
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
|
|
4
|
+
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/vite.ts
|
|
7
|
-
var vite_default =
|
|
7
|
+
var vite_default = _chunkYFLTUCKGcjs.plugin_default.vite;
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.default = vite_default;
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
|
|
4
|
+
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/webpack.ts
|
|
7
|
-
var webpack_default =
|
|
7
|
+
var webpack_default = _chunkYFLTUCKGcjs.plugin_default.webpack;
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.default = webpack_default;
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-tailwindcss-mangle",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.3",
|
|
5
5
|
"description": "mangle tailwindcss utilities class plugin. support vite and webpack!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"dist"
|
|
66
66
|
],
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@rollup/pluginutils": "^5.1.
|
|
68
|
+
"@rollup/pluginutils": "^5.1.4",
|
|
69
69
|
"is-css-request": "^1.0.1",
|
|
70
|
-
"magic-string": "^0.30.
|
|
71
|
-
"unplugin": "^
|
|
72
|
-
"@tailwindcss-mangle/config": "^
|
|
73
|
-
"@tailwindcss-mangle/core": "^4.0.
|
|
70
|
+
"magic-string": "^0.30.17",
|
|
71
|
+
"unplugin": "^2.2.0",
|
|
72
|
+
"@tailwindcss-mangle/config": "^5.0.0",
|
|
73
|
+
"@tailwindcss-mangle/core": "^4.0.3",
|
|
74
74
|
"@tailwindcss-mangle/shared": "^4.0.1"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
package/dist/chunk-QJCZGHDW.cjs
DELETED
|
@@ -1,297 +0,0 @@
|
|
|
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(); } }// 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@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
7
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
8
|
-
function normalizeWindowsPath(input = "") {
|
|
9
|
-
if (!input) {
|
|
10
|
-
return input;
|
|
11
|
-
}
|
|
12
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
13
|
-
}
|
|
14
|
-
var _UNC_REGEX = /^[/\\]{2}/;
|
|
15
|
-
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
16
|
-
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
17
|
-
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
18
|
-
var sep = "/";
|
|
19
|
-
var delimiter = ":";
|
|
20
|
-
var normalize = function(path2) {
|
|
21
|
-
if (path2.length === 0) {
|
|
22
|
-
return ".";
|
|
23
|
-
}
|
|
24
|
-
path2 = normalizeWindowsPath(path2);
|
|
25
|
-
const isUNCPath = path2.match(_UNC_REGEX);
|
|
26
|
-
const isPathAbsolute = isAbsolute(path2);
|
|
27
|
-
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
28
|
-
path2 = normalizeString(path2, !isPathAbsolute);
|
|
29
|
-
if (path2.length === 0) {
|
|
30
|
-
if (isPathAbsolute) {
|
|
31
|
-
return "/";
|
|
32
|
-
}
|
|
33
|
-
return trailingSeparator ? "./" : ".";
|
|
34
|
-
}
|
|
35
|
-
if (trailingSeparator) {
|
|
36
|
-
path2 += "/";
|
|
37
|
-
}
|
|
38
|
-
if (_DRIVE_LETTER_RE.test(path2)) {
|
|
39
|
-
path2 += "/";
|
|
40
|
-
}
|
|
41
|
-
if (isUNCPath) {
|
|
42
|
-
if (!isPathAbsolute) {
|
|
43
|
-
return `//./${path2}`;
|
|
44
|
-
}
|
|
45
|
-
return `//${path2}`;
|
|
46
|
-
}
|
|
47
|
-
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
48
|
-
};
|
|
49
|
-
var join = function(...arguments_) {
|
|
50
|
-
if (arguments_.length === 0) {
|
|
51
|
-
return ".";
|
|
52
|
-
}
|
|
53
|
-
let joined;
|
|
54
|
-
for (const argument of arguments_) {
|
|
55
|
-
if (argument && argument.length > 0) {
|
|
56
|
-
if (joined === void 0) {
|
|
57
|
-
joined = argument;
|
|
58
|
-
} else {
|
|
59
|
-
joined += `/${argument}`;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (joined === void 0) {
|
|
64
|
-
return ".";
|
|
65
|
-
}
|
|
66
|
-
return normalize(joined.replace(/\/\/+/g, "/"));
|
|
67
|
-
};
|
|
68
|
-
function cwd() {
|
|
69
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
70
|
-
return process.cwd().replace(/\\/g, "/");
|
|
71
|
-
}
|
|
72
|
-
return "/";
|
|
73
|
-
}
|
|
74
|
-
var resolve = function(...arguments_) {
|
|
75
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
76
|
-
let resolvedPath = "";
|
|
77
|
-
let resolvedAbsolute = false;
|
|
78
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
79
|
-
const path2 = index >= 0 ? arguments_[index] : cwd();
|
|
80
|
-
if (!path2 || path2.length === 0) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
resolvedPath = `${path2}/${resolvedPath}`;
|
|
84
|
-
resolvedAbsolute = isAbsolute(path2);
|
|
85
|
-
}
|
|
86
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
87
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
88
|
-
return `/${resolvedPath}`;
|
|
89
|
-
}
|
|
90
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
91
|
-
};
|
|
92
|
-
function normalizeString(path2, allowAboveRoot) {
|
|
93
|
-
let res = "";
|
|
94
|
-
let lastSegmentLength = 0;
|
|
95
|
-
let lastSlash = -1;
|
|
96
|
-
let dots = 0;
|
|
97
|
-
let char = null;
|
|
98
|
-
for (let index = 0; index <= path2.length; ++index) {
|
|
99
|
-
if (index < path2.length) {
|
|
100
|
-
char = path2[index];
|
|
101
|
-
} else if (char === "/") {
|
|
102
|
-
break;
|
|
103
|
-
} else {
|
|
104
|
-
char = "/";
|
|
105
|
-
}
|
|
106
|
-
if (char === "/") {
|
|
107
|
-
if (lastSlash === index - 1 || dots === 1) ;
|
|
108
|
-
else if (dots === 2) {
|
|
109
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
110
|
-
if (res.length > 2) {
|
|
111
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
112
|
-
if (lastSlashIndex === -1) {
|
|
113
|
-
res = "";
|
|
114
|
-
lastSegmentLength = 0;
|
|
115
|
-
} else {
|
|
116
|
-
res = res.slice(0, lastSlashIndex);
|
|
117
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
118
|
-
}
|
|
119
|
-
lastSlash = index;
|
|
120
|
-
dots = 0;
|
|
121
|
-
continue;
|
|
122
|
-
} else if (res.length > 0) {
|
|
123
|
-
res = "";
|
|
124
|
-
lastSegmentLength = 0;
|
|
125
|
-
lastSlash = index;
|
|
126
|
-
dots = 0;
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (allowAboveRoot) {
|
|
131
|
-
res += res.length > 0 ? "/.." : "..";
|
|
132
|
-
lastSegmentLength = 2;
|
|
133
|
-
}
|
|
134
|
-
} else {
|
|
135
|
-
if (res.length > 0) {
|
|
136
|
-
res += `/${path2.slice(lastSlash + 1, index)}`;
|
|
137
|
-
} else {
|
|
138
|
-
res = path2.slice(lastSlash + 1, index);
|
|
139
|
-
}
|
|
140
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
141
|
-
}
|
|
142
|
-
lastSlash = index;
|
|
143
|
-
dots = 0;
|
|
144
|
-
} else if (char === "." && dots !== -1) {
|
|
145
|
-
++dots;
|
|
146
|
-
} else {
|
|
147
|
-
dots = -1;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return res;
|
|
151
|
-
}
|
|
152
|
-
var isAbsolute = function(p) {
|
|
153
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
154
|
-
};
|
|
155
|
-
var toNamespacedPath = function(p) {
|
|
156
|
-
return normalizeWindowsPath(p);
|
|
157
|
-
};
|
|
158
|
-
var _EXTNAME_RE = /.(\.[^./]+)$/;
|
|
159
|
-
var extname = function(p) {
|
|
160
|
-
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
161
|
-
return match && match[1] || "";
|
|
162
|
-
};
|
|
163
|
-
var relative = function(from, to) {
|
|
164
|
-
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
165
|
-
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
166
|
-
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
167
|
-
return _to.join("/");
|
|
168
|
-
}
|
|
169
|
-
const _fromCopy = [..._from];
|
|
170
|
-
for (const segment of _fromCopy) {
|
|
171
|
-
if (_to[0] !== segment) {
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
_from.shift();
|
|
175
|
-
_to.shift();
|
|
176
|
-
}
|
|
177
|
-
return [..._from.map(() => ".."), ..._to].join("/");
|
|
178
|
-
};
|
|
179
|
-
var dirname = function(p) {
|
|
180
|
-
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
181
|
-
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
182
|
-
segments[0] += "/";
|
|
183
|
-
}
|
|
184
|
-
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
185
|
-
};
|
|
186
|
-
var format = function(p) {
|
|
187
|
-
const segments = [p.root, p.dir, _nullishCoalesce(p.base, () => ( p.name + p.ext))].filter(Boolean);
|
|
188
|
-
return normalizeWindowsPath(
|
|
189
|
-
p.root ? resolve(...segments) : segments.join("/")
|
|
190
|
-
);
|
|
191
|
-
};
|
|
192
|
-
var basename = function(p, extension) {
|
|
193
|
-
const lastSegment = normalizeWindowsPath(p).split("/").pop();
|
|
194
|
-
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
195
|
-
};
|
|
196
|
-
var parse = function(p) {
|
|
197
|
-
const root = normalizeWindowsPath(p).split("/").shift() || "/";
|
|
198
|
-
const base = basename(p);
|
|
199
|
-
const extension = extname(base);
|
|
200
|
-
return {
|
|
201
|
-
root,
|
|
202
|
-
dir: dirname(p),
|
|
203
|
-
base,
|
|
204
|
-
ext: extension,
|
|
205
|
-
name: base.slice(0, base.length - extension.length)
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
var path = {
|
|
209
|
-
__proto__: null,
|
|
210
|
-
basename,
|
|
211
|
-
delimiter,
|
|
212
|
-
dirname,
|
|
213
|
-
extname,
|
|
214
|
-
format,
|
|
215
|
-
isAbsolute,
|
|
216
|
-
join,
|
|
217
|
-
normalize,
|
|
218
|
-
normalizeString,
|
|
219
|
-
parse,
|
|
220
|
-
relative,
|
|
221
|
-
resolve,
|
|
222
|
-
sep,
|
|
223
|
-
toNamespacedPath
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
// src/constants.ts
|
|
227
|
-
var pluginName = "unplugin-tailwindcss-mangle";
|
|
228
|
-
|
|
229
|
-
// src/utils.ts
|
|
230
|
-
|
|
231
|
-
function escapeStringRegexp(str) {
|
|
232
|
-
if (typeof str !== "string") {
|
|
233
|
-
throw new TypeError("Expected a string");
|
|
234
|
-
}
|
|
235
|
-
return str.replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&").replaceAll("-", "\\x2d");
|
|
236
|
-
}
|
|
237
|
-
function getGroupedEntries(entries, options = {
|
|
238
|
-
cssMatcher(file) {
|
|
239
|
-
return /\.css$/.test(file);
|
|
240
|
-
},
|
|
241
|
-
htmlMatcher(file) {
|
|
242
|
-
return /\.html?$/.test(file);
|
|
243
|
-
},
|
|
244
|
-
jsMatcher(file) {
|
|
245
|
-
return /\.[cm]?js$/.test(file);
|
|
246
|
-
}
|
|
247
|
-
}) {
|
|
248
|
-
const { cssMatcher, htmlMatcher, jsMatcher } = options;
|
|
249
|
-
const groupedEntries = _shared.groupBy.call(void 0, entries, ([file]) => {
|
|
250
|
-
if (cssMatcher(file)) {
|
|
251
|
-
return "css";
|
|
252
|
-
} else if (htmlMatcher(file)) {
|
|
253
|
-
return "html";
|
|
254
|
-
} else if (jsMatcher(file)) {
|
|
255
|
-
return "js";
|
|
256
|
-
} else {
|
|
257
|
-
return "other";
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
if (!groupedEntries.css) {
|
|
261
|
-
groupedEntries.css = [];
|
|
262
|
-
}
|
|
263
|
-
if (!groupedEntries.html) {
|
|
264
|
-
groupedEntries.html = [];
|
|
265
|
-
}
|
|
266
|
-
if (!groupedEntries.js) {
|
|
267
|
-
groupedEntries.js = [];
|
|
268
|
-
}
|
|
269
|
-
if (!groupedEntries.other) {
|
|
270
|
-
groupedEntries.other = [];
|
|
271
|
-
}
|
|
272
|
-
return groupedEntries;
|
|
273
|
-
}
|
|
274
|
-
function getCacheDir(basedir = _process2.default.cwd()) {
|
|
275
|
-
return path.resolve(basedir, "node_modules/.cache", pluginName);
|
|
276
|
-
}
|
|
277
|
-
async function ensureDir(p) {
|
|
278
|
-
try {
|
|
279
|
-
await _promises2.default.access(p);
|
|
280
|
-
} catch (e) {
|
|
281
|
-
await _promises2.default.mkdir(p, {
|
|
282
|
-
recursive: true
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
exports.path = path; 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;
|