unplugin-tailwindcss-mangle 4.0.5 → 4.0.7

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.
@@ -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 = (path2, pattern) => {
165
+ var zeptomatch = (path, pattern) => {
173
166
  if (!_match) {
174
167
  _match = _lazyMatch();
175
168
  _lazyMatch = null;
176
169
  }
177
- return _match(path2, pattern);
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(path2) {
194
- if (path2.length === 0) {
186
+ var normalize = function(path) {
187
+ if (path.length === 0) {
195
188
  return ".";
196
189
  }
197
- path2 = normalizeWindowsPath(path2);
198
- const isUNCPath = path2.match(_UNC_REGEX);
199
- const isPathAbsolute = isAbsolute(path2);
200
- const trailingSeparator = path2[path2.length - 1] === "/";
201
- path2 = normalizeString(path2, !isPathAbsolute);
202
- if (path2.length === 0) {
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
- path2 += "/";
202
+ path += "/";
210
203
  }
211
- if (_DRIVE_LETTER_RE.test(path2)) {
212
- path2 += "/";
204
+ if (_DRIVE_LETTER_RE.test(path)) {
205
+ path += "/";
213
206
  }
214
207
  if (isUNCPath) {
215
208
  if (!isPathAbsolute) {
216
- return `//./${path2}`;
209
+ return `//./${path}`;
217
210
  }
218
- return `//${path2}`;
211
+ return `//${path}`;
219
212
  }
220
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
213
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
221
214
  };
222
215
  var join = function(...segments) {
223
- let path2 = "";
216
+ let path = "";
224
217
  for (const seg of segments) {
225
218
  if (!seg) {
226
219
  continue;
227
220
  }
228
- if (path2.length > 0) {
229
- const pathTrailing = path2[path2.length - 1] === "/";
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
- path2 += seg.slice(1);
226
+ path += seg.slice(1);
234
227
  } else {
235
- path2 += pathTrailing || segLeading ? seg : `/${seg}`;
228
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
236
229
  }
237
230
  } else {
238
- path2 += seg;
231
+ path += seg;
239
232
  }
240
233
  }
241
- return normalize(path2);
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 path2 = index >= 0 ? arguments_[index] : cwd();
255
- if (!path2 || path2.length === 0) {
247
+ const path = index >= 0 ? arguments_[index] : cwd();
248
+ if (!path || path.length === 0) {
256
249
  continue;
257
250
  }
258
- resolvedPath = `${path2}/${resolvedPath}`;
259
- resolvedAbsolute = isAbsolute(path2);
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(path2, allowAboveRoot) {
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 <= path2.length; ++index) {
274
- if (index < path2.length) {
275
- char = path2[index];
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 += `/${path2.slice(lastSlash + 1, index)}`;
304
+ res += `/${path.slice(lastSlash + 1, index)}`;
312
305
  } else {
313
- res = path2.slice(lastSlash + 1, index);
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 = (path2, pattern) => {
395
- return zeptomatch(pattern, normalize(path2));
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/core/loader.cjs" : "core/loader.cjs");
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;
@@ -1,9 +1,11 @@
1
1
  import {
2
- __dirname,
3
2
  getGroupedEntries,
4
3
  pluginName,
5
4
  posix
6
- } from "./chunk-DRXELMFM.js";
5
+ } from "./chunk-DTQBBX45.js";
6
+ import {
7
+ __dirname
8
+ } from "./chunk-OYNJH3A7.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/core/loader.cjs" : "core/loader.cjs");
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;
@@ -0,0 +1,10 @@
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
+ export {
9
+ __dirname
10
+ };
package/dist/esbuild.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
3
+ var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
4
4
  require('./chunk-BZZ6FFT4.cjs');
5
5
 
6
6
  // src/esbuild.ts
7
- var esbuild_default = _chunkYFLTUCKGcjs.plugin_default.esbuild;
7
+ var esbuild_default = _chunkE66B4GJ5cjs.plugin_default.esbuild;
8
8
 
9
9
 
10
10
  exports.default = esbuild_default;
package/dist/esbuild.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  plugin_default
3
- } from "./chunk-CI6RSKGG.js";
4
- import "./chunk-DRXELMFM.js";
3
+ } from "./chunk-GU5YYCH3.js";
4
+ import "./chunk-DTQBBX45.js";
5
+ import "./chunk-OYNJH3A7.js";
5
6
 
6
7
  // src/esbuild.ts
7
8
  var esbuild_default = plugin_default.esbuild;
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
3
+ var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
4
4
  require('./chunk-BZZ6FFT4.cjs');
5
5
 
6
6
 
7
- exports.default = _chunkYFLTUCKGcjs.plugin_default;
7
+ exports.default = _chunkE66B4GJ5cjs.plugin_default;
8
8
 
9
9
  module.exports = exports.default;
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  plugin_default
3
- } from "./chunk-CI6RSKGG.js";
4
- import "./chunk-DRXELMFM.js";
3
+ } from "./chunk-GU5YYCH3.js";
4
+ import "./chunk-DTQBBX45.js";
5
+ import "./chunk-OYNJH3A7.js";
5
6
  export {
6
7
  plugin_default as default
7
8
  };
@@ -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;
@@ -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-OYNJH3A7.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 _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
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(_chunkYFLTUCKGcjs.plugin_default.webpack(options));
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(_chunkYFLTUCKGcjs.plugin_default.vite(options));
14
+ config.plugins.push(_chunkE66B4GJ5cjs.plugin_default.vite(options));
15
15
  });
16
16
  }
17
17
 
package/dist/nuxt.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  plugin_default
3
- } from "./chunk-CI6RSKGG.js";
4
- import "./chunk-DRXELMFM.js";
3
+ } from "./chunk-GU5YYCH3.js";
4
+ import "./chunk-DTQBBX45.js";
5
+ import "./chunk-OYNJH3A7.js";
5
6
 
6
7
  // src/nuxt.ts
7
8
  function nuxt_default(options = {}, nuxt) {
package/dist/rollup.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
3
+ var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
4
4
  require('./chunk-BZZ6FFT4.cjs');
5
5
 
6
6
  // src/rollup.ts
7
- var rollup_default = _chunkYFLTUCKGcjs.plugin_default.rollup;
7
+ var rollup_default = _chunkE66B4GJ5cjs.plugin_default.rollup;
8
8
 
9
9
 
10
10
  exports.default = rollup_default;
package/dist/rollup.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  plugin_default
3
- } from "./chunk-CI6RSKGG.js";
4
- import "./chunk-DRXELMFM.js";
3
+ } from "./chunk-GU5YYCH3.js";
4
+ import "./chunk-DTQBBX45.js";
5
+ import "./chunk-OYNJH3A7.js";
5
6
 
6
7
  // src/rollup.ts
7
8
  var rollup_default = plugin_default.rollup;
package/dist/utils.js CHANGED
@@ -6,7 +6,8 @@ import {
6
6
  getGroupedEntries,
7
7
  isMap,
8
8
  isRegexp
9
- } from "./chunk-DRXELMFM.js";
9
+ } from "./chunk-DTQBBX45.js";
10
+ import "./chunk-OYNJH3A7.js";
10
11
  export {
11
12
  defaultMangleClassFilter,
12
13
  ensureDir,
package/dist/vite.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
3
+ var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
4
4
  require('./chunk-BZZ6FFT4.cjs');
5
5
 
6
6
  // src/vite.ts
7
- var vite_default = _chunkYFLTUCKGcjs.plugin_default.vite;
7
+ var vite_default = _chunkE66B4GJ5cjs.plugin_default.vite;
8
8
 
9
9
 
10
10
  exports.default = vite_default;
package/dist/vite.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  plugin_default
3
- } from "./chunk-CI6RSKGG.js";
4
- import "./chunk-DRXELMFM.js";
3
+ } from "./chunk-GU5YYCH3.js";
4
+ import "./chunk-DTQBBX45.js";
5
+ import "./chunk-OYNJH3A7.js";
5
6
 
6
7
  // src/vite.ts
7
8
  var vite_default = plugin_default.vite;
package/dist/webpack.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYFLTUCKGcjs = require('./chunk-YFLTUCKG.cjs');
3
+ var _chunkE66B4GJ5cjs = require('./chunk-E66B4GJ5.cjs');
4
4
  require('./chunk-BZZ6FFT4.cjs');
5
5
 
6
6
  // src/webpack.ts
7
- var webpack_default = _chunkYFLTUCKGcjs.plugin_default.webpack;
7
+ var webpack_default = _chunkE66B4GJ5cjs.plugin_default.webpack;
8
8
 
9
9
 
10
10
  exports.default = webpack_default;
package/dist/webpack.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  plugin_default
3
- } from "./chunk-CI6RSKGG.js";
4
- import "./chunk-DRXELMFM.js";
3
+ } from "./chunk-GU5YYCH3.js";
4
+ import "./chunk-DTQBBX45.js";
5
+ import "./chunk-OYNJH3A7.js";
5
6
 
6
7
  // src/webpack.ts
7
8
  var webpack_default = plugin_default.webpack;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-tailwindcss-mangle",
3
3
  "type": "module",
4
- "version": "4.0.5",
4
+ "version": "4.0.7",
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,8 +69,8 @@
69
69
  "is-css-request": "^1.0.1",
70
70
  "magic-string": "^0.30.17",
71
71
  "unplugin": "^2.2.0",
72
- "@tailwindcss-mangle/core": "^4.0.5",
73
- "@tailwindcss-mangle/config": "^5.0.2",
72
+ "@tailwindcss-mangle/core": "^4.0.6",
73
+ "@tailwindcss-mangle/config": "^5.0.3",
74
74
  "@tailwindcss-mangle/shared": "^4.0.1"
75
75
  },
76
76
  "publishConfig": {