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
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
const require_utils = require("./utils-DnTj6vm7.cjs");
|
|
2
|
+
let _rollup_pluginutils = require("@rollup/pluginutils");
|
|
3
|
+
let _tailwindcss_mangle_core = require("@tailwindcss-mangle/core");
|
|
4
|
+
let is_css_request = require("is-css-request");
|
|
5
|
+
let pathe = require("pathe");
|
|
6
|
+
pathe = require_utils.__toESM(pathe, 1);
|
|
7
|
+
let unplugin = require("unplugin");
|
|
8
|
+
//#region src/core/factory.ts
|
|
9
|
+
const WEBPACK_LOADER = pathe.default.resolve(__dirname, "./loader.cjs");
|
|
10
|
+
const JS_LIKE_EXTENSIONS = new Set([
|
|
11
|
+
".js",
|
|
12
|
+
".cjs",
|
|
13
|
+
".mjs",
|
|
14
|
+
".ts",
|
|
15
|
+
".cts",
|
|
16
|
+
".mts",
|
|
17
|
+
".jsx",
|
|
18
|
+
".tsx"
|
|
19
|
+
]);
|
|
20
|
+
const HTML_LIKE_EXTENSIONS = new Set([".html", ".htm"]);
|
|
21
|
+
const CSS_LIKE_LANGS = new Set([
|
|
22
|
+
"css",
|
|
23
|
+
"less",
|
|
24
|
+
"sass",
|
|
25
|
+
"scss",
|
|
26
|
+
"styl",
|
|
27
|
+
"stylus",
|
|
28
|
+
"pcss",
|
|
29
|
+
"postcss",
|
|
30
|
+
"sss"
|
|
31
|
+
]);
|
|
32
|
+
const JS_LIKE_LANGS = new Set([
|
|
33
|
+
"js",
|
|
34
|
+
"cjs",
|
|
35
|
+
"mjs",
|
|
36
|
+
"ts",
|
|
37
|
+
"cts",
|
|
38
|
+
"mts",
|
|
39
|
+
"jsx",
|
|
40
|
+
"tsx"
|
|
41
|
+
]);
|
|
42
|
+
const HTML_LIKE_LANGS = new Set(["html", "htm"]);
|
|
43
|
+
function normalizeLang(rawLang) {
|
|
44
|
+
if (!rawLang) return "";
|
|
45
|
+
return rawLang.toLowerCase().replace(/^\./, "");
|
|
46
|
+
}
|
|
47
|
+
function isLikelyMarkup(code) {
|
|
48
|
+
return /<[a-z][\w:-]*(?:\s|>)/i.test(code);
|
|
49
|
+
}
|
|
50
|
+
function isHtmlFileRequest(id) {
|
|
51
|
+
const cleanId = id.split("?")[0] ?? id;
|
|
52
|
+
const ext = pathe.default.extname(cleanId).toLowerCase();
|
|
53
|
+
return HTML_LIKE_EXTENSIONS.has(ext);
|
|
54
|
+
}
|
|
55
|
+
function resolveTransformKind(id, code) {
|
|
56
|
+
if ((0, is_css_request.isCSSRequest)(id)) return "css";
|
|
57
|
+
const cleanId = id.split("?")[0] ?? id;
|
|
58
|
+
const ext = pathe.default.extname(cleanId).toLowerCase();
|
|
59
|
+
const query = id.includes("?") ? id.slice(id.indexOf("?") + 1) : "";
|
|
60
|
+
const params = new URLSearchParams(query);
|
|
61
|
+
const type = params.get("type")?.toLowerCase();
|
|
62
|
+
const lang = normalizeLang(params.get("lang"));
|
|
63
|
+
if (type === "style") return "css";
|
|
64
|
+
if (type === "script") return "js";
|
|
65
|
+
if (type === "template") {
|
|
66
|
+
if (lang && JS_LIKE_LANGS.has(lang)) return "js";
|
|
67
|
+
if (lang && HTML_LIKE_LANGS.has(lang)) return "html";
|
|
68
|
+
return isLikelyMarkup(code) ? "html" : "js";
|
|
69
|
+
}
|
|
70
|
+
if (lang) {
|
|
71
|
+
if (CSS_LIKE_LANGS.has(lang)) return "css";
|
|
72
|
+
if (JS_LIKE_LANGS.has(lang)) return "js";
|
|
73
|
+
if (HTML_LIKE_LANGS.has(lang)) return "html";
|
|
74
|
+
if (lang === "vue") return "vue";
|
|
75
|
+
if (lang === "svelte") return "svelte";
|
|
76
|
+
}
|
|
77
|
+
if (ext === ".vue") return "vue";
|
|
78
|
+
if (ext === ".svelte") return "svelte";
|
|
79
|
+
if (HTML_LIKE_EXTENSIONS.has(ext)) return "html";
|
|
80
|
+
if (JS_LIKE_EXTENSIONS.has(ext)) return "js";
|
|
81
|
+
return isLikelyMarkup(code) ? "html" : "js";
|
|
82
|
+
}
|
|
83
|
+
const factory = (options) => {
|
|
84
|
+
const ctx = new _tailwindcss_mangle_core.Context();
|
|
85
|
+
let filter = (0, _rollup_pluginutils.createFilter)(options?.sources?.include, options?.sources?.exclude);
|
|
86
|
+
return [
|
|
87
|
+
{
|
|
88
|
+
name: `${require_utils.pluginName}:pre`,
|
|
89
|
+
enforce: "pre",
|
|
90
|
+
async buildStart() {
|
|
91
|
+
const initOptions = options === void 0 ? {} : { transformerOptions: options };
|
|
92
|
+
await ctx.initConfig(initOptions);
|
|
93
|
+
filter = (0, _rollup_pluginutils.createFilter)(ctx.options.sources?.include, ctx.options.sources?.exclude);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: `${require_utils.pluginName}`,
|
|
98
|
+
transformInclude(id) {
|
|
99
|
+
const cleanId = id.split("?")[0] ?? id;
|
|
100
|
+
if (isHtmlFileRequest(cleanId)) return false;
|
|
101
|
+
return filter(cleanId);
|
|
102
|
+
},
|
|
103
|
+
async transform(code, id) {
|
|
104
|
+
const opts = {
|
|
105
|
+
ctx,
|
|
106
|
+
id
|
|
107
|
+
};
|
|
108
|
+
const kind = resolveTransformKind(id, code);
|
|
109
|
+
const framework = this.getNativeBuildContext?.().framework;
|
|
110
|
+
if ((framework === "webpack" || framework === "rspack") && kind === "html" && isHtmlFileRequest(id)) return null;
|
|
111
|
+
switch (kind) {
|
|
112
|
+
case "css": return await (0, _tailwindcss_mangle_core.cssHandler)(code, opts);
|
|
113
|
+
case "vue": return await (0, _tailwindcss_mangle_core.vueHandler)(code, opts);
|
|
114
|
+
case "svelte": return await (0, _tailwindcss_mangle_core.svelteHandler)(code, opts);
|
|
115
|
+
case "html": return (0, _tailwindcss_mangle_core.htmlHandler)(code, opts);
|
|
116
|
+
default: return (0, _tailwindcss_mangle_core.jsHandler)(code, opts);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
webpack(compiler) {
|
|
120
|
+
const { NormalModule } = compiler.webpack;
|
|
121
|
+
compiler.hooks.compilation.tap(require_utils.pluginName, (compilation) => {
|
|
122
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(require_utils.pluginName, (_loaderContext, module) => {
|
|
123
|
+
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
124
|
+
if (idx > -1) module.loaders.splice(idx, 0, {
|
|
125
|
+
loader: WEBPACK_LOADER,
|
|
126
|
+
ident: null,
|
|
127
|
+
options: { ctx },
|
|
128
|
+
type: null
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: `${require_utils.pluginName}:post`,
|
|
136
|
+
enforce: "post",
|
|
137
|
+
vite: { transformIndexHtml(html) {
|
|
138
|
+
const { code } = (0, _tailwindcss_mangle_core.htmlHandler)(html, { ctx });
|
|
139
|
+
return code;
|
|
140
|
+
} },
|
|
141
|
+
webpack(compiler) {
|
|
142
|
+
const { Compilation, sources } = compiler.webpack;
|
|
143
|
+
const { ConcatSource } = sources;
|
|
144
|
+
compiler.hooks.compilation.tap(require_utils.pluginName, (compilation) => {
|
|
145
|
+
compilation.hooks.processAssets.tapPromise({
|
|
146
|
+
name: require_utils.pluginName,
|
|
147
|
+
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
148
|
+
}, async (assets) => {
|
|
149
|
+
const groupedEntries = require_utils.getGroupedEntries(Object.entries(assets));
|
|
150
|
+
for (const [id, cssSource] of groupedEntries.css) {
|
|
151
|
+
const { code } = await (0, _tailwindcss_mangle_core.cssHandler)(cssSource.source().toString(), {
|
|
152
|
+
id,
|
|
153
|
+
ctx
|
|
154
|
+
});
|
|
155
|
+
const source = new ConcatSource(code);
|
|
156
|
+
compilation.updateAsset(id, source);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
writeBundle() {
|
|
162
|
+
ctx.dump();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/core/plugin.ts
|
|
169
|
+
const unplugin$1 = (0, unplugin.createUnplugin)(factory);
|
|
170
|
+
//#endregion
|
|
171
|
+
Object.defineProperty(exports, "unplugin", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function() {
|
|
174
|
+
return unplugin$1;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { a as getGroupedEntries, c as pluginName } from "./utils-CT4s62m9.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { createFilter } from "@rollup/pluginutils";
|
|
5
|
+
import { Context, cssHandler, htmlHandler, jsHandler, svelteHandler, vueHandler } from "@tailwindcss-mangle/core";
|
|
6
|
+
import { isCSSRequest } from "is-css-request";
|
|
7
|
+
import path$1 from "pathe";
|
|
8
|
+
import { createUnplugin } from "unplugin";
|
|
9
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.10_synckit@0.11.12_typescript@6.0.3/node_modules/tsdown/esm-shims.js
|
|
10
|
+
const getFilename = () => fileURLToPath(import.meta.url);
|
|
11
|
+
const getDirname = () => path.dirname(getFilename());
|
|
12
|
+
const __dirname = /* @__PURE__ */ getDirname();
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/core/factory.ts
|
|
15
|
+
const WEBPACK_LOADER = path$1.resolve(__dirname, "./loader.cjs");
|
|
16
|
+
const JS_LIKE_EXTENSIONS = new Set([
|
|
17
|
+
".js",
|
|
18
|
+
".cjs",
|
|
19
|
+
".mjs",
|
|
20
|
+
".ts",
|
|
21
|
+
".cts",
|
|
22
|
+
".mts",
|
|
23
|
+
".jsx",
|
|
24
|
+
".tsx"
|
|
25
|
+
]);
|
|
26
|
+
const HTML_LIKE_EXTENSIONS = new Set([".html", ".htm"]);
|
|
27
|
+
const CSS_LIKE_LANGS = new Set([
|
|
28
|
+
"css",
|
|
29
|
+
"less",
|
|
30
|
+
"sass",
|
|
31
|
+
"scss",
|
|
32
|
+
"styl",
|
|
33
|
+
"stylus",
|
|
34
|
+
"pcss",
|
|
35
|
+
"postcss",
|
|
36
|
+
"sss"
|
|
37
|
+
]);
|
|
38
|
+
const JS_LIKE_LANGS = new Set([
|
|
39
|
+
"js",
|
|
40
|
+
"cjs",
|
|
41
|
+
"mjs",
|
|
42
|
+
"ts",
|
|
43
|
+
"cts",
|
|
44
|
+
"mts",
|
|
45
|
+
"jsx",
|
|
46
|
+
"tsx"
|
|
47
|
+
]);
|
|
48
|
+
const HTML_LIKE_LANGS = new Set(["html", "htm"]);
|
|
49
|
+
function normalizeLang(rawLang) {
|
|
50
|
+
if (!rawLang) return "";
|
|
51
|
+
return rawLang.toLowerCase().replace(/^\./, "");
|
|
52
|
+
}
|
|
53
|
+
function isLikelyMarkup(code) {
|
|
54
|
+
return /<[a-z][\w:-]*(?:\s|>)/i.test(code);
|
|
55
|
+
}
|
|
56
|
+
function isHtmlFileRequest(id) {
|
|
57
|
+
const cleanId = id.split("?")[0] ?? id;
|
|
58
|
+
const ext = path$1.extname(cleanId).toLowerCase();
|
|
59
|
+
return HTML_LIKE_EXTENSIONS.has(ext);
|
|
60
|
+
}
|
|
61
|
+
function resolveTransformKind(id, code) {
|
|
62
|
+
if (isCSSRequest(id)) return "css";
|
|
63
|
+
const cleanId = id.split("?")[0] ?? id;
|
|
64
|
+
const ext = path$1.extname(cleanId).toLowerCase();
|
|
65
|
+
const query = id.includes("?") ? id.slice(id.indexOf("?") + 1) : "";
|
|
66
|
+
const params = new URLSearchParams(query);
|
|
67
|
+
const type = params.get("type")?.toLowerCase();
|
|
68
|
+
const lang = normalizeLang(params.get("lang"));
|
|
69
|
+
if (type === "style") return "css";
|
|
70
|
+
if (type === "script") return "js";
|
|
71
|
+
if (type === "template") {
|
|
72
|
+
if (lang && JS_LIKE_LANGS.has(lang)) return "js";
|
|
73
|
+
if (lang && HTML_LIKE_LANGS.has(lang)) return "html";
|
|
74
|
+
return isLikelyMarkup(code) ? "html" : "js";
|
|
75
|
+
}
|
|
76
|
+
if (lang) {
|
|
77
|
+
if (CSS_LIKE_LANGS.has(lang)) return "css";
|
|
78
|
+
if (JS_LIKE_LANGS.has(lang)) return "js";
|
|
79
|
+
if (HTML_LIKE_LANGS.has(lang)) return "html";
|
|
80
|
+
if (lang === "vue") return "vue";
|
|
81
|
+
if (lang === "svelte") return "svelte";
|
|
82
|
+
}
|
|
83
|
+
if (ext === ".vue") return "vue";
|
|
84
|
+
if (ext === ".svelte") return "svelte";
|
|
85
|
+
if (HTML_LIKE_EXTENSIONS.has(ext)) return "html";
|
|
86
|
+
if (JS_LIKE_EXTENSIONS.has(ext)) return "js";
|
|
87
|
+
return isLikelyMarkup(code) ? "html" : "js";
|
|
88
|
+
}
|
|
89
|
+
const factory = (options) => {
|
|
90
|
+
const ctx = new Context();
|
|
91
|
+
let filter = createFilter(options?.sources?.include, options?.sources?.exclude);
|
|
92
|
+
return [
|
|
93
|
+
{
|
|
94
|
+
name: `${pluginName}:pre`,
|
|
95
|
+
enforce: "pre",
|
|
96
|
+
async buildStart() {
|
|
97
|
+
const initOptions = options === void 0 ? {} : { transformerOptions: options };
|
|
98
|
+
await ctx.initConfig(initOptions);
|
|
99
|
+
filter = createFilter(ctx.options.sources?.include, ctx.options.sources?.exclude);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: `${pluginName}`,
|
|
104
|
+
transformInclude(id) {
|
|
105
|
+
const cleanId = id.split("?")[0] ?? id;
|
|
106
|
+
if (isHtmlFileRequest(cleanId)) return false;
|
|
107
|
+
return filter(cleanId);
|
|
108
|
+
},
|
|
109
|
+
async transform(code, id) {
|
|
110
|
+
const opts = {
|
|
111
|
+
ctx,
|
|
112
|
+
id
|
|
113
|
+
};
|
|
114
|
+
const kind = resolveTransformKind(id, code);
|
|
115
|
+
const framework = this.getNativeBuildContext?.().framework;
|
|
116
|
+
if ((framework === "webpack" || framework === "rspack") && kind === "html" && isHtmlFileRequest(id)) return null;
|
|
117
|
+
switch (kind) {
|
|
118
|
+
case "css": return await cssHandler(code, opts);
|
|
119
|
+
case "vue": return await vueHandler(code, opts);
|
|
120
|
+
case "svelte": return await svelteHandler(code, opts);
|
|
121
|
+
case "html": return htmlHandler(code, opts);
|
|
122
|
+
default: return jsHandler(code, opts);
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
webpack(compiler) {
|
|
126
|
+
const { NormalModule } = compiler.webpack;
|
|
127
|
+
compiler.hooks.compilation.tap(pluginName, (compilation) => {
|
|
128
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(pluginName, (_loaderContext, module) => {
|
|
129
|
+
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
130
|
+
if (idx > -1) module.loaders.splice(idx, 0, {
|
|
131
|
+
loader: WEBPACK_LOADER,
|
|
132
|
+
ident: null,
|
|
133
|
+
options: { ctx },
|
|
134
|
+
type: null
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: `${pluginName}:post`,
|
|
142
|
+
enforce: "post",
|
|
143
|
+
vite: { transformIndexHtml(html) {
|
|
144
|
+
const { code } = htmlHandler(html, { ctx });
|
|
145
|
+
return code;
|
|
146
|
+
} },
|
|
147
|
+
webpack(compiler) {
|
|
148
|
+
const { Compilation, sources } = compiler.webpack;
|
|
149
|
+
const { ConcatSource } = sources;
|
|
150
|
+
compiler.hooks.compilation.tap(pluginName, (compilation) => {
|
|
151
|
+
compilation.hooks.processAssets.tapPromise({
|
|
152
|
+
name: pluginName,
|
|
153
|
+
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
154
|
+
}, async (assets) => {
|
|
155
|
+
const groupedEntries = getGroupedEntries(Object.entries(assets));
|
|
156
|
+
for (const [id, cssSource] of groupedEntries.css) {
|
|
157
|
+
const { code } = await cssHandler(cssSource.source().toString(), {
|
|
158
|
+
id,
|
|
159
|
+
ctx
|
|
160
|
+
});
|
|
161
|
+
const source = new ConcatSource(code);
|
|
162
|
+
compilation.updateAsset(id, source);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
writeBundle() {
|
|
168
|
+
ctx.dump();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
];
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/core/plugin.ts
|
|
175
|
+
const unplugin = createUnplugin(factory);
|
|
176
|
+
//#endregion
|
|
177
|
+
export { unplugin as t };
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// src/esbuild.ts
|
|
7
|
-
var esbuild_default = _chunkA24OOU3Ccjs.plugin_default.esbuild;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.default = esbuild_default;
|
|
11
|
-
|
|
12
|
-
module.exports = exports.default;
|
|
1
|
+
//#region src/esbuild.ts
|
|
2
|
+
var esbuild_default = require("./core-C8BPj6VA.cjs").unplugin.esbuild;
|
|
3
|
+
//#endregion
|
|
4
|
+
module.exports = esbuild_default;
|
package/dist/esbuild.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _$_tailwindcss_mangle_config0 from "@tailwindcss-mangle/config";
|
|
2
|
+
import * as _$esbuild from "esbuild";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export = _default;
|
|
4
|
+
//#region src/esbuild.d.ts
|
|
5
|
+
declare const _default: (options?: _$_tailwindcss_mangle_config0.TransformerOptions | undefined) => _$esbuild.Plugin;
|
|
6
|
+
export = _default;
|
package/dist/esbuild.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _$_tailwindcss_mangle_config0 from "@tailwindcss-mangle/config";
|
|
2
|
+
import * as _$esbuild from "esbuild";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
//#region src/esbuild.d.ts
|
|
5
|
+
declare const _default: (options?: _$_tailwindcss_mangle_config0.TransformerOptions | undefined) => _$esbuild.Plugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/esbuild.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// src/esbuild.ts
|
|
8
|
-
var esbuild_default = plugin_default.esbuild;
|
|
9
|
-
export {
|
|
10
|
-
esbuild_default as default
|
|
11
|
-
};
|
|
1
|
+
import { t as unplugin } from "./core-ClSeSCtC.js";
|
|
2
|
+
//#region src/esbuild.ts
|
|
3
|
+
var esbuild_default = unplugin.esbuild;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { esbuild_default as default };
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _chunkA24OOU3Ccjs = require('./chunk-A24OOU3C.cjs');
|
|
4
|
-
require('./chunk-QGD6AWGR.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = _chunkA24OOU3Ccjs.plugin_default;
|
|
8
|
-
|
|
9
|
-
module.exports = exports.default;
|
|
1
|
+
const require_core = require("./core-C8BPj6VA.cjs");
|
|
2
|
+
module.exports = require_core.unplugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _$_tailwindcss_mangle_config0 from "@tailwindcss-mangle/config";
|
|
2
|
+
import * as _$unplugin from "unplugin";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export = unplugin;
|
|
4
|
+
//#region src/core/plugin.d.ts
|
|
5
|
+
declare const unplugin: _$unplugin.UnpluginInstance<_$_tailwindcss_mangle_config0.TransformerOptions | undefined, boolean>;
|
|
6
|
+
export = unplugin;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _$unplugin from "unplugin";
|
|
2
|
+
import * as _$_tailwindcss_mangle_config0 from "@tailwindcss-mangle/config";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
//#region src/core/plugin.d.ts
|
|
5
|
+
declare const unplugin: _$unplugin.UnpluginInstance<_$_tailwindcss_mangle_config0.TransformerOptions | undefined, boolean>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { unplugin as default };
|
package/dist/index.js
CHANGED
package/dist/loader.cjs
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
1
|
+
require("./utils-DnTj6vm7.cjs");
|
|
2
|
+
let _tailwindcss_mangle_core = require("@tailwindcss-mangle/core");
|
|
3
|
+
//#region src/loader.ts
|
|
3
4
|
async function TailwindcssMangleWebpackLoader(source) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const callback = this.async();
|
|
6
|
+
const { ctx } = this.getOptions();
|
|
7
|
+
const { code } = await (0, _tailwindcss_mangle_core.cssHandler)(source, {
|
|
8
|
+
ctx,
|
|
9
|
+
id: this.resource
|
|
10
|
+
});
|
|
11
|
+
callback(null, code);
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.default = loader_default;
|
|
16
|
-
|
|
17
|
-
module.exports = exports.default;
|
|
13
|
+
//#endregion
|
|
14
|
+
module.exports = TailwindcssMangleWebpackLoader;
|
package/dist/loader.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Context } from
|
|
2
|
-
import { LoaderContext } from
|
|
1
|
+
import { Context } from "@tailwindcss-mangle/core";
|
|
2
|
+
import { LoaderContext } from "webpack";
|
|
3
3
|
|
|
4
|
+
//#region src/loader.d.ts
|
|
4
5
|
declare function TailwindcssMangleWebpackLoader(this: LoaderContext<{
|
|
5
|
-
|
|
6
|
+
ctx: Context;
|
|
6
7
|
}>, source: string): Promise<void>;
|
|
7
|
-
|
|
8
|
-
export = TailwindcssMangleWebpackLoader;
|
|
8
|
+
export = TailwindcssMangleWebpackLoader;
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Context } from
|
|
2
|
-
import { LoaderContext } from
|
|
1
|
+
import { Context } from "@tailwindcss-mangle/core";
|
|
2
|
+
import { LoaderContext } from "webpack";
|
|
3
3
|
|
|
4
|
+
//#region src/loader.d.ts
|
|
4
5
|
declare function TailwindcssMangleWebpackLoader(this: LoaderContext<{
|
|
5
|
-
|
|
6
|
+
ctx: Context;
|
|
6
7
|
}>, source: string): Promise<void>;
|
|
7
|
-
|
|
8
|
-
export { TailwindcssMangleWebpackLoader as default };
|
|
8
|
+
//#endregion
|
|
9
|
+
export { TailwindcssMangleWebpackLoader as default };
|
package/dist/loader.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import "./chunk-BYKP5MUG.js";
|
|
2
|
-
|
|
3
|
-
// src/loader.ts
|
|
4
1
|
import { cssHandler } from "@tailwindcss-mangle/core";
|
|
2
|
+
//#region src/loader.ts
|
|
5
3
|
async function TailwindcssMangleWebpackLoader(source) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const callback = this.async();
|
|
5
|
+
const { ctx } = this.getOptions();
|
|
6
|
+
const { code } = await cssHandler(source, {
|
|
7
|
+
ctx,
|
|
8
|
+
id: this.resource
|
|
9
|
+
});
|
|
10
|
+
callback(null, code);
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
loader_default as default
|
|
17
|
-
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TailwindcssMangleWebpackLoader as default };
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _chunkA24OOU3Ccjs = require('./chunk-A24OOU3C.cjs');
|
|
4
|
-
require('./chunk-QGD6AWGR.cjs');
|
|
5
|
-
|
|
6
|
-
// src/nuxt.ts
|
|
1
|
+
const require_core = require("./core-C8BPj6VA.cjs");
|
|
2
|
+
//#region src/nuxt.ts
|
|
7
3
|
function nuxt_default(options = {}, nuxt) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
nuxt.hook("webpack:config", (config) => {
|
|
5
|
+
config.plugins = config.plugins || [];
|
|
6
|
+
config.plugins.unshift(require_core.unplugin.webpack(options));
|
|
7
|
+
});
|
|
8
|
+
nuxt.hook("vite:extendConfig", (config) => {
|
|
9
|
+
config.plugins = config.plugins || [];
|
|
10
|
+
config.plugins.push(require_core.unplugin.vite(options));
|
|
11
|
+
});
|
|
16
12
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
exports.default = nuxt_default;
|
|
20
|
-
|
|
21
|
-
module.exports = exports.default;
|
|
13
|
+
//#endregion
|
|
14
|
+
module.exports = nuxt_default;
|
package/dist/nuxt.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export = export_default;
|
|
1
|
+
import * as import__tailwindcss_mangle_config from "@tailwindcss-mangle/config";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/nuxt.d.ts
|
|
4
|
+
declare function export_default(options: types_d_exports.TransformerOptions | undefined, nuxt: any): void;
|
|
5
|
+
export = export_default;
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as import__tailwindcss_mangle_config from "@tailwindcss-mangle/config";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/nuxt.d.ts
|
|
4
|
+
declare function export_default(options: types_d_exports.TransformerOptions | undefined, nuxt: any): void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { export_default as default };
|
package/dist/nuxt.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-QNSTX4YB.js";
|
|
4
|
-
import "./chunk-TVEX3BIF.js";
|
|
5
|
-
import "./chunk-BYKP5MUG.js";
|
|
6
|
-
|
|
7
|
-
// src/nuxt.ts
|
|
1
|
+
import { t as unplugin } from "./core-ClSeSCtC.js";
|
|
2
|
+
//#region src/nuxt.ts
|
|
8
3
|
function nuxt_default(options = {}, nuxt) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
nuxt.hook("webpack:config", (config) => {
|
|
5
|
+
config.plugins = config.plugins || [];
|
|
6
|
+
config.plugins.unshift(unplugin.webpack(options));
|
|
7
|
+
});
|
|
8
|
+
nuxt.hook("vite:extendConfig", (config) => {
|
|
9
|
+
config.plugins = config.plugins || [];
|
|
10
|
+
config.plugins.push(unplugin.vite(options));
|
|
11
|
+
});
|
|
17
12
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { nuxt_default as default };
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// src/rollup.ts
|
|
7
|
-
var rollup_default = _chunkA24OOU3Ccjs.plugin_default.rollup;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.default = rollup_default;
|
|
11
|
-
|
|
12
|
-
module.exports = exports.default;
|
|
1
|
+
//#region src/rollup.ts
|
|
2
|
+
var rollup_default = require("./core-C8BPj6VA.cjs").unplugin.rollup;
|
|
3
|
+
//#endregion
|
|
4
|
+
module.exports = rollup_default;
|