unplugin-tailwindcss-mangle 5.1.2-alpha.1 → 5.1.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/dist/core-C8BPj6VA.cjs +176 -0
- package/dist/core-ClSeSCtC.js +177 -0
- package/dist/esbuild.cjs +4 -12
- package/dist/esbuild.d.cts +5 -5
- package/dist/esbuild.d.ts +6 -5
- package/dist/esbuild.js +5 -11
- package/dist/index.cjs +2 -9
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +2 -8
- package/dist/loader.cjs +12 -15
- package/dist/loader.d.cts +5 -5
- package/dist/loader.d.ts +6 -5
- package/dist/loader.js +10 -14
- package/dist/nuxt.cjs +12 -19
- package/dist/nuxt.d.cts +5 -5
- package/dist/nuxt.d.ts +6 -5
- package/dist/nuxt.js +12 -18
- package/dist/rollup.cjs +4 -12
- package/dist/rollup.d.cts +5 -5
- package/dist/rollup.d.ts +6 -5
- package/dist/rollup.js +5 -11
- package/dist/utils-CT4s62m9.js +48 -0
- package/dist/utils-DnTj6vm7.cjs +108 -0
- package/dist/utils.cjs +25 -18
- package/dist/utils.d.cts +7 -6
- package/dist/utils.d.ts +7 -6
- package/dist/utils.js +2 -19
- package/dist/vite.cjs +4 -12
- package/dist/vite.d.cts +5 -5
- package/dist/vite.d.ts +6 -5
- package/dist/vite.js +5 -11
- package/dist/webpack.cjs +4 -12
- package/dist/webpack.d.cts +5 -5
- package/dist/webpack.d.ts +6 -5
- package/dist/webpack.js +5 -11
- package/package.json +6 -6
- package/dist/chunk-A24OOU3C.cjs +0 -201
- package/dist/chunk-BYKP5MUG.js +0 -10
- package/dist/chunk-QGD6AWGR.cjs +0 -495
- package/dist/chunk-QNSTX4YB.js +0 -204
- package/dist/chunk-TVEX3BIF.js +0 -495
package/dist/chunk-A24OOU3C.cjs
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _chunkQGD6AWGRcjs = require('./chunk-QGD6AWGR.cjs');
|
|
6
|
-
|
|
7
|
-
// src/core/plugin.ts
|
|
8
|
-
var _unplugin = require('unplugin');
|
|
9
|
-
|
|
10
|
-
// src/core/factory.ts
|
|
11
|
-
var _pluginutils = require('@rollup/pluginutils');
|
|
12
|
-
var _core = require('@tailwindcss-mangle/core');
|
|
13
|
-
var _iscssrequest = require('is-css-request');
|
|
14
|
-
var WEBPACK_LOADER = _chunkQGD6AWGRcjs.posix.resolve(__dirname, false ? "../../dist/loader.cjs" : "./loader.cjs");
|
|
15
|
-
var JS_LIKE_EXTENSIONS = /* @__PURE__ */ new Set([".js", ".cjs", ".mjs", ".ts", ".cts", ".mts", ".jsx", ".tsx"]);
|
|
16
|
-
var HTML_LIKE_EXTENSIONS = /* @__PURE__ */ new Set([".html", ".htm"]);
|
|
17
|
-
var CSS_LIKE_LANGS = /* @__PURE__ */ new Set(["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"]);
|
|
18
|
-
var JS_LIKE_LANGS = /* @__PURE__ */ new Set(["js", "cjs", "mjs", "ts", "cts", "mts", "jsx", "tsx"]);
|
|
19
|
-
var HTML_LIKE_LANGS = /* @__PURE__ */ new Set(["html", "htm"]);
|
|
20
|
-
function normalizeLang(rawLang) {
|
|
21
|
-
if (!rawLang) {
|
|
22
|
-
return "";
|
|
23
|
-
}
|
|
24
|
-
return rawLang.toLowerCase().replace(/^\./, "");
|
|
25
|
-
}
|
|
26
|
-
function isLikelyMarkup(code) {
|
|
27
|
-
return /<[a-z][\w:-]*(?:\s|>)/i.test(code);
|
|
28
|
-
}
|
|
29
|
-
function isHtmlFileRequest(id) {
|
|
30
|
-
const cleanId = _nullishCoalesce(id.split("?")[0], () => ( id));
|
|
31
|
-
const ext = _chunkQGD6AWGRcjs.posix.extname(cleanId).toLowerCase();
|
|
32
|
-
return HTML_LIKE_EXTENSIONS.has(ext);
|
|
33
|
-
}
|
|
34
|
-
function resolveTransformKind(id, code) {
|
|
35
|
-
if (_iscssrequest.isCSSRequest.call(void 0, id)) {
|
|
36
|
-
return "css";
|
|
37
|
-
}
|
|
38
|
-
const cleanId = _nullishCoalesce(id.split("?")[0], () => ( id));
|
|
39
|
-
const ext = _chunkQGD6AWGRcjs.posix.extname(cleanId).toLowerCase();
|
|
40
|
-
const query = id.includes("?") ? id.slice(id.indexOf("?") + 1) : "";
|
|
41
|
-
const params = new URLSearchParams(query);
|
|
42
|
-
const type = _optionalChain([params, 'access', _ => _.get, 'call', _2 => _2("type"), 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]);
|
|
43
|
-
const lang = normalizeLang(params.get("lang"));
|
|
44
|
-
if (type === "style") {
|
|
45
|
-
return "css";
|
|
46
|
-
}
|
|
47
|
-
if (type === "script") {
|
|
48
|
-
return "js";
|
|
49
|
-
}
|
|
50
|
-
if (type === "template") {
|
|
51
|
-
if (lang && JS_LIKE_LANGS.has(lang)) {
|
|
52
|
-
return "js";
|
|
53
|
-
}
|
|
54
|
-
if (lang && HTML_LIKE_LANGS.has(lang)) {
|
|
55
|
-
return "html";
|
|
56
|
-
}
|
|
57
|
-
return isLikelyMarkup(code) ? "html" : "js";
|
|
58
|
-
}
|
|
59
|
-
if (lang) {
|
|
60
|
-
if (CSS_LIKE_LANGS.has(lang)) {
|
|
61
|
-
return "css";
|
|
62
|
-
}
|
|
63
|
-
if (JS_LIKE_LANGS.has(lang)) {
|
|
64
|
-
return "js";
|
|
65
|
-
}
|
|
66
|
-
if (HTML_LIKE_LANGS.has(lang)) {
|
|
67
|
-
return "html";
|
|
68
|
-
}
|
|
69
|
-
if (lang === "vue") {
|
|
70
|
-
return "vue";
|
|
71
|
-
}
|
|
72
|
-
if (lang === "svelte") {
|
|
73
|
-
return "svelte";
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (ext === ".vue") {
|
|
77
|
-
return "vue";
|
|
78
|
-
}
|
|
79
|
-
if (ext === ".svelte") {
|
|
80
|
-
return "svelte";
|
|
81
|
-
}
|
|
82
|
-
if (HTML_LIKE_EXTENSIONS.has(ext)) {
|
|
83
|
-
return "html";
|
|
84
|
-
}
|
|
85
|
-
if (JS_LIKE_EXTENSIONS.has(ext)) {
|
|
86
|
-
return "js";
|
|
87
|
-
}
|
|
88
|
-
return isLikelyMarkup(code) ? "html" : "js";
|
|
89
|
-
}
|
|
90
|
-
var factory = (options) => {
|
|
91
|
-
const ctx = new (0, _core.Context)();
|
|
92
|
-
let filter = _pluginutils.createFilter.call(void 0, _optionalChain([options, 'optionalAccess', _5 => _5.sources, 'optionalAccess', _6 => _6.include]), _optionalChain([options, 'optionalAccess', _7 => _7.sources, 'optionalAccess', _8 => _8.exclude]));
|
|
93
|
-
return [
|
|
94
|
-
{
|
|
95
|
-
name: `${_chunkQGD6AWGRcjs.pluginName}:pre`,
|
|
96
|
-
enforce: "pre",
|
|
97
|
-
async buildStart() {
|
|
98
|
-
const initOptions = options === void 0 ? {} : { transformerOptions: options };
|
|
99
|
-
await ctx.initConfig(initOptions);
|
|
100
|
-
filter = _pluginutils.createFilter.call(void 0, _optionalChain([ctx, 'access', _9 => _9.options, 'access', _10 => _10.sources, 'optionalAccess', _11 => _11.include]), _optionalChain([ctx, 'access', _12 => _12.options, 'access', _13 => _13.sources, 'optionalAccess', _14 => _14.exclude]));
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: `${_chunkQGD6AWGRcjs.pluginName}`,
|
|
105
|
-
transformInclude(id) {
|
|
106
|
-
const cleanId = _nullishCoalesce(id.split("?")[0], () => ( id));
|
|
107
|
-
if (isHtmlFileRequest(cleanId)) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
return filter(cleanId);
|
|
111
|
-
},
|
|
112
|
-
async transform(code, id) {
|
|
113
|
-
const opts = {
|
|
114
|
-
ctx,
|
|
115
|
-
id
|
|
116
|
-
};
|
|
117
|
-
const kind = resolveTransformKind(id, code);
|
|
118
|
-
const framework = _optionalChain([this, 'access', _15 => _15.getNativeBuildContext, 'optionalCall', _16 => _16(), 'access', _17 => _17.framework]);
|
|
119
|
-
if ((framework === "webpack" || framework === "rspack") && kind === "html" && isHtmlFileRequest(id)) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
switch (kind) {
|
|
123
|
-
case "css":
|
|
124
|
-
return await _core.cssHandler.call(void 0, code, opts);
|
|
125
|
-
case "vue":
|
|
126
|
-
return await _core.vueHandler.call(void 0, code, opts);
|
|
127
|
-
case "svelte":
|
|
128
|
-
return await _core.svelteHandler.call(void 0, code, opts);
|
|
129
|
-
case "html":
|
|
130
|
-
return _core.htmlHandler.call(void 0, code, opts);
|
|
131
|
-
case "js":
|
|
132
|
-
default:
|
|
133
|
-
return _core.jsHandler.call(void 0, code, opts);
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
webpack(compiler) {
|
|
137
|
-
const { NormalModule } = compiler.webpack;
|
|
138
|
-
compiler.hooks.compilation.tap(_chunkQGD6AWGRcjs.pluginName, (compilation) => {
|
|
139
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkQGD6AWGRcjs.pluginName, (_loaderContext, module) => {
|
|
140
|
-
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
141
|
-
if (idx > -1) {
|
|
142
|
-
module.loaders.splice(idx, 0, {
|
|
143
|
-
loader: WEBPACK_LOADER,
|
|
144
|
-
ident: null,
|
|
145
|
-
options: {
|
|
146
|
-
ctx
|
|
147
|
-
},
|
|
148
|
-
type: null
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
name: `${_chunkQGD6AWGRcjs.pluginName}:post`,
|
|
157
|
-
enforce: "post",
|
|
158
|
-
vite: {
|
|
159
|
-
transformIndexHtml(html) {
|
|
160
|
-
const { code } = _core.htmlHandler.call(void 0, html, { ctx });
|
|
161
|
-
return code;
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
webpack(compiler) {
|
|
165
|
-
const { Compilation, sources } = compiler.webpack;
|
|
166
|
-
const { ConcatSource } = sources;
|
|
167
|
-
compiler.hooks.compilation.tap(_chunkQGD6AWGRcjs.pluginName, (compilation) => {
|
|
168
|
-
compilation.hooks.processAssets.tapPromise(
|
|
169
|
-
{
|
|
170
|
-
name: _chunkQGD6AWGRcjs.pluginName,
|
|
171
|
-
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
172
|
-
},
|
|
173
|
-
async (assets) => {
|
|
174
|
-
const groupedEntries = _chunkQGD6AWGRcjs.getGroupedEntries.call(void 0, Object.entries(assets));
|
|
175
|
-
for (const [id, cssSource] of groupedEntries.css) {
|
|
176
|
-
const { code } = await _core.cssHandler.call(void 0, cssSource.source().toString(), {
|
|
177
|
-
id,
|
|
178
|
-
ctx
|
|
179
|
-
});
|
|
180
|
-
const source = new ConcatSource(code);
|
|
181
|
-
compilation.updateAsset(id, source);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
);
|
|
185
|
-
});
|
|
186
|
-
},
|
|
187
|
-
writeBundle() {
|
|
188
|
-
ctx.dump();
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
];
|
|
192
|
-
};
|
|
193
|
-
var factory_default = factory;
|
|
194
|
-
|
|
195
|
-
// src/core/plugin.ts
|
|
196
|
-
var unplugin = _unplugin.createUnplugin.call(void 0, factory_default);
|
|
197
|
-
var plugin_default = unplugin;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
exports.plugin_default = plugin_default;
|
package/dist/chunk-BYKP5MUG.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
var getFilename = () => fileURLToPath(import.meta.url);
|
|
5
|
-
var getDirname = () => path.dirname(getFilename());
|
|
6
|
-
var __dirname = /* @__PURE__ */ getDirname();
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
__dirname
|
|
10
|
-
};
|