unplugin-tailwindcss-mangle 4.0.6 → 4.0.8
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/dist/{chunk-DRXELMFM.js → chunk-DTQBBX45.js} +35 -43
- package/dist/{chunk-YFLTUCKG.cjs → chunk-E66B4GJ5.cjs} +1 -1
- package/dist/chunk-X3SYYE2F.js +10 -0
- package/dist/{chunk-CI6RSKGG.js → chunk-ZYIRTSIT.js} +5 -3
- package/dist/esbuild.cjs +2 -2
- package/dist/esbuild.js +3 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +3 -2
- package/dist/loader.cjs +17 -0
- package/dist/loader.d.cts +8 -0
- package/dist/loader.d.ts +8 -0
- package/dist/loader.js +17 -0
- package/dist/nuxt.cjs +3 -3
- package/dist/nuxt.js +3 -2
- package/dist/rollup.cjs +2 -2
- package/dist/rollup.js +3 -2
- package/dist/utils.js +2 -1
- package/dist/vite.cjs +2 -2
- package/dist/vite.js +3 -2
- package/dist/webpack.cjs +2 -2
- package/dist/webpack.js +3 -2
- package/package.json +4 -4
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.2_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
3
|
-
import path from "path";
|
|
4
|
-
var getFilename = () => fileURLToPath(import.meta.url);
|
|
5
|
-
var getDirname = () => path.dirname(getFilename());
|
|
6
|
-
var __dirname = /* @__PURE__ */ getDirname();
|
|
7
|
-
|
|
8
1
|
// src/utils.ts
|
|
9
2
|
import fs from "node:fs/promises";
|
|
10
3
|
import process2 from "node:process";
|
|
@@ -169,12 +162,12 @@ var _lazyMatch = () => {
|
|
|
169
162
|
return __lib__.default || __lib__;
|
|
170
163
|
};
|
|
171
164
|
var _match;
|
|
172
|
-
var zeptomatch = (
|
|
165
|
+
var zeptomatch = (path, pattern) => {
|
|
173
166
|
if (!_match) {
|
|
174
167
|
_match = _lazyMatch();
|
|
175
168
|
_lazyMatch = null;
|
|
176
169
|
}
|
|
177
|
-
return _match(
|
|
170
|
+
return _match(path, pattern);
|
|
178
171
|
};
|
|
179
172
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
180
173
|
function normalizeWindowsPath(input = "") {
|
|
@@ -190,55 +183,55 @@ var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
|
190
183
|
var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
191
184
|
var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
192
185
|
var sep = "/";
|
|
193
|
-
var normalize = function(
|
|
194
|
-
if (
|
|
186
|
+
var normalize = function(path) {
|
|
187
|
+
if (path.length === 0) {
|
|
195
188
|
return ".";
|
|
196
189
|
}
|
|
197
|
-
|
|
198
|
-
const isUNCPath =
|
|
199
|
-
const isPathAbsolute = isAbsolute(
|
|
200
|
-
const trailingSeparator =
|
|
201
|
-
|
|
202
|
-
if (
|
|
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) {
|
|
203
196
|
if (isPathAbsolute) {
|
|
204
197
|
return "/";
|
|
205
198
|
}
|
|
206
199
|
return trailingSeparator ? "./" : ".";
|
|
207
200
|
}
|
|
208
201
|
if (trailingSeparator) {
|
|
209
|
-
|
|
202
|
+
path += "/";
|
|
210
203
|
}
|
|
211
|
-
if (_DRIVE_LETTER_RE.test(
|
|
212
|
-
|
|
204
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
205
|
+
path += "/";
|
|
213
206
|
}
|
|
214
207
|
if (isUNCPath) {
|
|
215
208
|
if (!isPathAbsolute) {
|
|
216
|
-
return `//./${
|
|
209
|
+
return `//./${path}`;
|
|
217
210
|
}
|
|
218
|
-
return `//${
|
|
211
|
+
return `//${path}`;
|
|
219
212
|
}
|
|
220
|
-
return isPathAbsolute && !isAbsolute(
|
|
213
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
221
214
|
};
|
|
222
215
|
var join = function(...segments) {
|
|
223
|
-
let
|
|
216
|
+
let path = "";
|
|
224
217
|
for (const seg of segments) {
|
|
225
218
|
if (!seg) {
|
|
226
219
|
continue;
|
|
227
220
|
}
|
|
228
|
-
if (
|
|
229
|
-
const pathTrailing =
|
|
221
|
+
if (path.length > 0) {
|
|
222
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
230
223
|
const segLeading = seg[0] === "/";
|
|
231
224
|
const both = pathTrailing && segLeading;
|
|
232
225
|
if (both) {
|
|
233
|
-
|
|
226
|
+
path += seg.slice(1);
|
|
234
227
|
} else {
|
|
235
|
-
|
|
228
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
236
229
|
}
|
|
237
230
|
} else {
|
|
238
|
-
|
|
231
|
+
path += seg;
|
|
239
232
|
}
|
|
240
233
|
}
|
|
241
|
-
return normalize(
|
|
234
|
+
return normalize(path);
|
|
242
235
|
};
|
|
243
236
|
function cwd() {
|
|
244
237
|
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
@@ -251,12 +244,12 @@ var resolve = function(...arguments_) {
|
|
|
251
244
|
let resolvedPath = "";
|
|
252
245
|
let resolvedAbsolute = false;
|
|
253
246
|
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
247
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
248
|
+
if (!path || path.length === 0) {
|
|
256
249
|
continue;
|
|
257
250
|
}
|
|
258
|
-
resolvedPath = `${
|
|
259
|
-
resolvedAbsolute = isAbsolute(
|
|
251
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
252
|
+
resolvedAbsolute = isAbsolute(path);
|
|
260
253
|
}
|
|
261
254
|
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
262
255
|
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
@@ -264,15 +257,15 @@ var resolve = function(...arguments_) {
|
|
|
264
257
|
}
|
|
265
258
|
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
266
259
|
};
|
|
267
|
-
function normalizeString(
|
|
260
|
+
function normalizeString(path, allowAboveRoot) {
|
|
268
261
|
let res = "";
|
|
269
262
|
let lastSegmentLength = 0;
|
|
270
263
|
let lastSlash = -1;
|
|
271
264
|
let dots = 0;
|
|
272
265
|
let char = null;
|
|
273
|
-
for (let index = 0; index <=
|
|
274
|
-
if (index <
|
|
275
|
-
char =
|
|
266
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
267
|
+
if (index < path.length) {
|
|
268
|
+
char = path[index];
|
|
276
269
|
} else if (char === "/") {
|
|
277
270
|
break;
|
|
278
271
|
} else {
|
|
@@ -308,9 +301,9 @@ function normalizeString(path2, allowAboveRoot) {
|
|
|
308
301
|
}
|
|
309
302
|
} else {
|
|
310
303
|
if (res.length > 0) {
|
|
311
|
-
res += `/${
|
|
304
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
312
305
|
} else {
|
|
313
|
-
res =
|
|
306
|
+
res = path.slice(lastSlash + 1, index);
|
|
314
307
|
}
|
|
315
308
|
lastSegmentLength = index - lastSlash - 1;
|
|
316
309
|
}
|
|
@@ -391,8 +384,8 @@ var parse = function(p) {
|
|
|
391
384
|
name: base.slice(0, base.length - extension.length)
|
|
392
385
|
};
|
|
393
386
|
};
|
|
394
|
-
var matchesGlob = (
|
|
395
|
-
return zeptomatch(pattern, normalize(
|
|
387
|
+
var matchesGlob = (path, pattern) => {
|
|
388
|
+
return zeptomatch(pattern, normalize(path));
|
|
396
389
|
};
|
|
397
390
|
var _path = {
|
|
398
391
|
__proto__: null,
|
|
@@ -490,7 +483,6 @@ async function ensureDir(p) {
|
|
|
490
483
|
}
|
|
491
484
|
|
|
492
485
|
export {
|
|
493
|
-
__dirname,
|
|
494
486
|
posix,
|
|
495
487
|
pluginName,
|
|
496
488
|
escapeStringRegexp,
|
|
@@ -11,7 +11,7 @@ var _unplugin = require('unplugin');
|
|
|
11
11
|
var _pluginutils = require('@rollup/pluginutils');
|
|
12
12
|
var _core = require('@tailwindcss-mangle/core');
|
|
13
13
|
var _iscssrequest = require('is-css-request');
|
|
14
|
-
var WEBPACK_LOADER = _chunkBZZ6FFT4cjs.posix.resolve(__dirname, false ? "../../dist/
|
|
14
|
+
var WEBPACK_LOADER = _chunkBZZ6FFT4cjs.posix.resolve(__dirname, false ? "../../dist/loader.cjs" : "./loader.cjs");
|
|
15
15
|
var factory = (options) => {
|
|
16
16
|
const ctx = new (0, _core.Context)();
|
|
17
17
|
let filter = (_id) => true;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import path from "path";
|
|
4
|
+
var getFilename = () => fileURLToPath(import.meta.url);
|
|
5
|
+
var getDirname = () => path.dirname(getFilename());
|
|
6
|
+
var __dirname = /* @__PURE__ */ getDirname();
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__dirname
|
|
10
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__dirname,
|
|
3
2
|
getGroupedEntries,
|
|
4
3
|
pluginName,
|
|
5
4
|
posix
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DTQBBX45.js";
|
|
6
|
+
import {
|
|
7
|
+
__dirname
|
|
8
|
+
} from "./chunk-X3SYYE2F.js";
|
|
7
9
|
|
|
8
10
|
// src/core/plugin.ts
|
|
9
11
|
import { createUnplugin } from "unplugin";
|
|
@@ -12,7 +14,7 @@ import { createUnplugin } from "unplugin";
|
|
|
12
14
|
import { createFilter } from "@rollup/pluginutils";
|
|
13
15
|
import { Context, cssHandler, htmlHandler, jsHandler } from "@tailwindcss-mangle/core";
|
|
14
16
|
import { isCSSRequest } from "is-css-request";
|
|
15
|
-
var WEBPACK_LOADER = posix.resolve(__dirname, false ? "../../dist/
|
|
17
|
+
var WEBPACK_LOADER = posix.resolve(__dirname, false ? "../../dist/loader.cjs" : "./loader.cjs");
|
|
16
18
|
var factory = (options) => {
|
|
17
19
|
const ctx = new Context();
|
|
18
20
|
let filter = (_id) => true;
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
|
|
4
4
|
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/esbuild.ts
|
|
7
|
-
var esbuild_default =
|
|
7
|
+
var esbuild_default = _chunkE66B4GJ5cjs.plugin_default.esbuild;
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.default = esbuild_default;
|
package/dist/esbuild.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
|
|
4
4
|
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.default =
|
|
7
|
+
exports.default = _chunkE66B4GJ5cjs.plugin_default;
|
|
8
8
|
|
|
9
9
|
module.exports = exports.default;
|
package/dist/index.js
CHANGED
package/dist/loader.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/loader.ts
|
|
2
|
+
var _core = require('@tailwindcss-mangle/core');
|
|
3
|
+
var TailwindcssMangleWebpackLoader = async function(source) {
|
|
4
|
+
const callback = this.async();
|
|
5
|
+
const { ctx } = this.getOptions();
|
|
6
|
+
const { code } = await _core.cssHandler.call(void 0, source, {
|
|
7
|
+
ctx,
|
|
8
|
+
id: this.resource
|
|
9
|
+
});
|
|
10
|
+
callback(null, code);
|
|
11
|
+
};
|
|
12
|
+
var loader_default = TailwindcssMangleWebpackLoader;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.default = loader_default;
|
|
16
|
+
|
|
17
|
+
module.exports = exports.default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Context } from '@tailwindcss-mangle/core';
|
|
2
|
+
import { LoaderContext } from 'webpack';
|
|
3
|
+
|
|
4
|
+
declare const TailwindcssMangleWebpackLoader: (this: LoaderContext<{
|
|
5
|
+
ctx: Context;
|
|
6
|
+
}>, source: string) => Promise<void>;
|
|
7
|
+
|
|
8
|
+
export = TailwindcssMangleWebpackLoader;
|
package/dist/loader.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Context } from '@tailwindcss-mangle/core';
|
|
2
|
+
import { LoaderContext } from 'webpack';
|
|
3
|
+
|
|
4
|
+
declare const TailwindcssMangleWebpackLoader: (this: LoaderContext<{
|
|
5
|
+
ctx: Context;
|
|
6
|
+
}>, source: string) => Promise<void>;
|
|
7
|
+
|
|
8
|
+
export { TailwindcssMangleWebpackLoader as default };
|
package/dist/loader.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./chunk-X3SYYE2F.js";
|
|
2
|
+
|
|
3
|
+
// src/loader.ts
|
|
4
|
+
import { cssHandler } from "@tailwindcss-mangle/core";
|
|
5
|
+
var TailwindcssMangleWebpackLoader = async function(source) {
|
|
6
|
+
const callback = this.async();
|
|
7
|
+
const { ctx } = this.getOptions();
|
|
8
|
+
const { code } = await cssHandler(source, {
|
|
9
|
+
ctx,
|
|
10
|
+
id: this.resource
|
|
11
|
+
});
|
|
12
|
+
callback(null, code);
|
|
13
|
+
};
|
|
14
|
+
var loader_default = TailwindcssMangleWebpackLoader;
|
|
15
|
+
export {
|
|
16
|
+
loader_default as default
|
|
17
|
+
};
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
|
|
4
4
|
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/nuxt.ts
|
|
7
7
|
function nuxt_default(options = {}, nuxt) {
|
|
8
8
|
nuxt.hook("webpack:config", (config) => {
|
|
9
9
|
config.plugins = config.plugins || [];
|
|
10
|
-
config.plugins.unshift(
|
|
10
|
+
config.plugins.unshift(_chunkE66B4GJ5cjs.plugin_default.webpack(options));
|
|
11
11
|
});
|
|
12
12
|
nuxt.hook("vite:extendConfig", (config) => {
|
|
13
13
|
config.plugins = config.plugins || [];
|
|
14
|
-
config.plugins.push(
|
|
14
|
+
config.plugins.push(_chunkE66B4GJ5cjs.plugin_default.vite(options));
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
|
package/dist/nuxt.js
CHANGED
package/dist/rollup.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
|
|
4
4
|
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/rollup.ts
|
|
7
|
-
var rollup_default =
|
|
7
|
+
var rollup_default = _chunkE66B4GJ5cjs.plugin_default.rollup;
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.default = rollup_default;
|
package/dist/rollup.js
CHANGED
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
|
|
3
|
+
var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
|
|
4
4
|
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/vite.ts
|
|
7
|
-
var vite_default =
|
|
7
|
+
var vite_default = _chunkE66B4GJ5cjs.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
|
|
3
|
+
var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
|
|
4
4
|
require('./chunk-BZZ6FFT4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/webpack.ts
|
|
7
|
-
var webpack_default =
|
|
7
|
+
var webpack_default = _chunkE66B4GJ5cjs.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.8",
|
|
5
5
|
"description": "mangle tailwindcss utilities class plugin. support vite and webpack!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"is-css-request": "^1.0.1",
|
|
70
70
|
"magic-string": "^0.30.17",
|
|
71
71
|
"unplugin": "^2.2.0",
|
|
72
|
-
"@tailwindcss-mangle/config": "^5.0.
|
|
73
|
-
"@tailwindcss-mangle/core": "^4.0.
|
|
74
|
-
"@tailwindcss-mangle/shared": "^4.0.
|
|
72
|
+
"@tailwindcss-mangle/config": "^5.0.4",
|
|
73
|
+
"@tailwindcss-mangle/core": "^4.0.7",
|
|
74
|
+
"@tailwindcss-mangle/shared": "^4.0.2"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public",
|