unplugin-tailwindcss-mangle 0.1.4 → 1.2.2
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/esbuild.js +1 -0
- package/dist/esbuild.mjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -28
- package/dist/index.mjs +18 -27
- package/dist/nuxt.js +1 -0
- package/dist/nuxt.mjs +1 -0
- package/dist/options.d.ts +4 -0
- package/dist/rollup.js +1 -0
- package/dist/rollup.mjs +1 -0
- package/dist/types.d.ts +5 -13
- package/dist/utils.d.ts +2 -10
- package/dist/vite.js +1 -0
- package/dist/vite.mjs +1 -0
- package/dist/webpack.js +1 -0
- package/dist/webpack.mjs +1 -0
- package/package.json +7 -6
package/dist/esbuild.js
CHANGED
package/dist/esbuild.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Options } from './types';
|
|
2
|
+
export { defaultMangleClassFilter } from 'tailwindcss-mangle-shared';
|
|
2
3
|
export declare const unplugin: import("unplugin").UnpluginInstance<Options | undefined, boolean>;
|
|
3
4
|
export declare const vitePlugin: (options?: Options | undefined) => import("vite").Plugin | import("vite").Plugin[];
|
|
4
5
|
export declare const webpackPlugin: (options?: Options | undefined) => import("webpack").WebpackPluginInstance;
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var unplugin$1 = require('unplugin');
|
|
|
6
6
|
var micromatch = require('micromatch');
|
|
7
7
|
var fs = require('fs');
|
|
8
8
|
var path = require('path');
|
|
9
|
+
var tailwindcssMangleShared = require('tailwindcss-mangle-shared');
|
|
9
10
|
var tailwindcssMangleCore = require('tailwindcss-mangle-core');
|
|
10
11
|
var tailwindcssPatch = require('tailwindcss-patch');
|
|
11
12
|
|
|
@@ -18,30 +19,6 @@ var path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
18
19
|
const pluginName = 'unplugin-tailwindcss-mangle';
|
|
19
20
|
|
|
20
21
|
const { isMatch } = micromatch__default["default"];
|
|
21
|
-
const isMangleClass = (className) => {
|
|
22
|
-
return /[-:]/.test(className);
|
|
23
|
-
};
|
|
24
|
-
function groupBy(arr, cb) {
|
|
25
|
-
if (!Array.isArray(arr)) {
|
|
26
|
-
throw new Error('expected an array for first argument');
|
|
27
|
-
}
|
|
28
|
-
if (typeof cb !== 'function') {
|
|
29
|
-
throw new Error('expected a function for second argument');
|
|
30
|
-
}
|
|
31
|
-
const result = {};
|
|
32
|
-
for (let i = 0; i < arr.length; i++) {
|
|
33
|
-
const item = arr[i];
|
|
34
|
-
const bucketCategory = cb(item);
|
|
35
|
-
const bucket = result[bucketCategory];
|
|
36
|
-
if (!Array.isArray(bucket)) {
|
|
37
|
-
result[bucketCategory] = [item];
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
result[bucketCategory].push(item);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
22
|
function getGroupedEntries(entries, options = {
|
|
46
23
|
cssMatcher(file) {
|
|
47
24
|
return /\.css$/.test(file);
|
|
@@ -54,7 +31,7 @@ function getGroupedEntries(entries, options = {
|
|
|
54
31
|
}
|
|
55
32
|
}) {
|
|
56
33
|
const { cssMatcher, htmlMatcher, jsMatcher } = options;
|
|
57
|
-
const groupedEntries = groupBy(entries, ([file]) => {
|
|
34
|
+
const groupedEntries = tailwindcssMangleShared.groupBy(entries, ([file]) => {
|
|
58
35
|
if (cssMatcher(file)) {
|
|
59
36
|
return 'css';
|
|
60
37
|
}
|
|
@@ -118,6 +95,7 @@ function cacheDump(filename, data, basedir) {
|
|
|
118
95
|
function getOptions(options = {}) {
|
|
119
96
|
const includeMatcher = createGlobMatcher(options.include, true);
|
|
120
97
|
const excludeMatcher = createGlobMatcher(options.exclude, false);
|
|
98
|
+
const currentMangleClassFilter = options.mangleClassFilter ?? tailwindcssMangleShared.defaultMangleClassFilter;
|
|
121
99
|
function isInclude(file) {
|
|
122
100
|
return includeMatcher(file) && !excludeMatcher(file);
|
|
123
101
|
}
|
|
@@ -144,7 +122,7 @@ function getOptions(options = {}) {
|
|
|
144
122
|
cacheDump(classSetOutputOptions.filename, set, classSetOutputOptions.dir);
|
|
145
123
|
}
|
|
146
124
|
set.forEach((c) => {
|
|
147
|
-
if (!
|
|
125
|
+
if (!currentMangleClassFilter(c)) {
|
|
148
126
|
set.delete(c);
|
|
149
127
|
}
|
|
150
128
|
});
|
|
@@ -162,13 +140,16 @@ function getOptions(options = {}) {
|
|
|
162
140
|
isInclude,
|
|
163
141
|
classSetOutputOptions,
|
|
164
142
|
classMapOutputOptions,
|
|
165
|
-
twPatcher
|
|
143
|
+
twPatcher,
|
|
144
|
+
jsHandlerOptions: (options.jsHandlerOptions ?? {}),
|
|
145
|
+
htmlHandlerOptions: (options.htmlHandlerOptions ?? {}),
|
|
146
|
+
cssHandlerOptions: (options.cssHandlerOptions ?? {})
|
|
166
147
|
};
|
|
167
148
|
}
|
|
168
149
|
|
|
169
150
|
const outputCachedMap = new Map();
|
|
170
151
|
const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
171
|
-
const { classGenerator, getCachedClassSet, isInclude, classMapOutputOptions } = getOptions(options);
|
|
152
|
+
const { classGenerator, getCachedClassSet, isInclude, classMapOutputOptions, htmlHandlerOptions, jsHandlerOptions, cssHandlerOptions } = getOptions(options);
|
|
172
153
|
return {
|
|
173
154
|
name: pluginName,
|
|
174
155
|
enforce: 'post',
|
|
@@ -185,6 +166,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
185
166
|
const [file, asset] = groupedEntries.html[i];
|
|
186
167
|
if (isInclude(file)) {
|
|
187
168
|
asset.source = tailwindcssMangleCore.htmlHandler(asset.source.toString(), {
|
|
169
|
+
...htmlHandlerOptions,
|
|
188
170
|
classGenerator,
|
|
189
171
|
runtimeSet
|
|
190
172
|
});
|
|
@@ -196,6 +178,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
196
178
|
const [file, chunk] = groupedEntries.js[i];
|
|
197
179
|
if (isInclude(file)) {
|
|
198
180
|
const code = tailwindcssMangleCore.jsHandler(chunk.code, {
|
|
181
|
+
...jsHandlerOptions,
|
|
199
182
|
runtimeSet,
|
|
200
183
|
classGenerator
|
|
201
184
|
}).code;
|
|
@@ -210,6 +193,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
210
193
|
const [file, css] = groupedEntries.css[i];
|
|
211
194
|
if (isInclude(file)) {
|
|
212
195
|
css.source = tailwindcssMangleCore.cssHandler(css.source.toString(), {
|
|
196
|
+
...cssHandlerOptions,
|
|
213
197
|
classGenerator,
|
|
214
198
|
runtimeSet
|
|
215
199
|
});
|
|
@@ -287,6 +271,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
287
271
|
const [file, asset] = groupedEntries.html[i];
|
|
288
272
|
if (isInclude(file)) {
|
|
289
273
|
const html = tailwindcssMangleCore.htmlHandler(asset.source().toString(), {
|
|
274
|
+
...htmlHandlerOptions,
|
|
290
275
|
classGenerator,
|
|
291
276
|
runtimeSet
|
|
292
277
|
});
|
|
@@ -300,6 +285,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
300
285
|
const [file, chunk] = groupedEntries.js[i];
|
|
301
286
|
if (isInclude(file)) {
|
|
302
287
|
const code = tailwindcssMangleCore.jsHandler(chunk.source().toString(), {
|
|
288
|
+
...jsHandlerOptions,
|
|
303
289
|
runtimeSet,
|
|
304
290
|
classGenerator
|
|
305
291
|
}).code;
|
|
@@ -315,6 +301,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
315
301
|
const [file, css] = groupedEntries.css[i];
|
|
316
302
|
if (isInclude(file)) {
|
|
317
303
|
const newCss = tailwindcssMangleCore.cssHandler(css.source().toString(), {
|
|
304
|
+
...cssHandlerOptions,
|
|
318
305
|
classGenerator,
|
|
319
306
|
runtimeSet
|
|
320
307
|
});
|
|
@@ -328,6 +315,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
328
315
|
html.forEach((asset, file) => {
|
|
329
316
|
if (isInclude(file)) {
|
|
330
317
|
const html = tailwindcssMangleCore.htmlHandler(asset.source().toString(), {
|
|
318
|
+
...htmlHandlerOptions,
|
|
331
319
|
classGenerator,
|
|
332
320
|
runtimeSet
|
|
333
321
|
});
|
|
@@ -341,6 +329,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
341
329
|
if (isInclude(file)) {
|
|
342
330
|
const rawCode = chunk.source().toString();
|
|
343
331
|
const code = tailwindcssMangleCore.jsHandler(rawCode, {
|
|
332
|
+
...jsHandlerOptions,
|
|
344
333
|
runtimeSet,
|
|
345
334
|
classGenerator
|
|
346
335
|
}).code;
|
|
@@ -355,6 +344,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
355
344
|
css.forEach((style, file) => {
|
|
356
345
|
if (isInclude(file)) {
|
|
357
346
|
const newCss = tailwindcssMangleCore.cssHandler(style.source().toString(), {
|
|
347
|
+
...cssHandlerOptions,
|
|
358
348
|
classGenerator,
|
|
359
349
|
runtimeSet
|
|
360
350
|
});
|
|
@@ -380,6 +370,10 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
380
370
|
const vitePlugin = unplugin.vite;
|
|
381
371
|
const webpackPlugin = unplugin.webpack;
|
|
382
372
|
|
|
373
|
+
Object.defineProperty(exports, 'defaultMangleClassFilter', {
|
|
374
|
+
enumerable: true,
|
|
375
|
+
get: function () { return tailwindcssMangleShared.defaultMangleClassFilter; }
|
|
376
|
+
});
|
|
383
377
|
exports.unplugin = unplugin;
|
|
384
378
|
exports.vitePlugin = vitePlugin;
|
|
385
379
|
exports.webpackPlugin = webpackPlugin;
|
package/dist/index.mjs
CHANGED
|
@@ -2,36 +2,14 @@ import { createUnplugin } from 'unplugin';
|
|
|
2
2
|
import micromatch from 'micromatch';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
|
+
import { groupBy, defaultMangleClassFilter } from 'tailwindcss-mangle-shared';
|
|
6
|
+
export { defaultMangleClassFilter } from 'tailwindcss-mangle-shared';
|
|
5
7
|
import { ClassGenerator, htmlHandler, jsHandler, cssHandler } from 'tailwindcss-mangle-core';
|
|
6
8
|
import { TailwindcssPatcher } from 'tailwindcss-patch';
|
|
7
9
|
|
|
8
10
|
const pluginName = 'unplugin-tailwindcss-mangle';
|
|
9
11
|
|
|
10
12
|
const { isMatch } = micromatch;
|
|
11
|
-
const isMangleClass = (className) => {
|
|
12
|
-
return /[-:]/.test(className);
|
|
13
|
-
};
|
|
14
|
-
function groupBy(arr, cb) {
|
|
15
|
-
if (!Array.isArray(arr)) {
|
|
16
|
-
throw new Error('expected an array for first argument');
|
|
17
|
-
}
|
|
18
|
-
if (typeof cb !== 'function') {
|
|
19
|
-
throw new Error('expected a function for second argument');
|
|
20
|
-
}
|
|
21
|
-
const result = {};
|
|
22
|
-
for (let i = 0; i < arr.length; i++) {
|
|
23
|
-
const item = arr[i];
|
|
24
|
-
const bucketCategory = cb(item);
|
|
25
|
-
const bucket = result[bucketCategory];
|
|
26
|
-
if (!Array.isArray(bucket)) {
|
|
27
|
-
result[bucketCategory] = [item];
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
result[bucketCategory].push(item);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
13
|
function getGroupedEntries(entries, options = {
|
|
36
14
|
cssMatcher(file) {
|
|
37
15
|
return /\.css$/.test(file);
|
|
@@ -108,6 +86,7 @@ function cacheDump(filename, data, basedir) {
|
|
|
108
86
|
function getOptions(options = {}) {
|
|
109
87
|
const includeMatcher = createGlobMatcher(options.include, true);
|
|
110
88
|
const excludeMatcher = createGlobMatcher(options.exclude, false);
|
|
89
|
+
const currentMangleClassFilter = options.mangleClassFilter ?? defaultMangleClassFilter;
|
|
111
90
|
function isInclude(file) {
|
|
112
91
|
return includeMatcher(file) && !excludeMatcher(file);
|
|
113
92
|
}
|
|
@@ -134,7 +113,7 @@ function getOptions(options = {}) {
|
|
|
134
113
|
cacheDump(classSetOutputOptions.filename, set, classSetOutputOptions.dir);
|
|
135
114
|
}
|
|
136
115
|
set.forEach((c) => {
|
|
137
|
-
if (!
|
|
116
|
+
if (!currentMangleClassFilter(c)) {
|
|
138
117
|
set.delete(c);
|
|
139
118
|
}
|
|
140
119
|
});
|
|
@@ -152,13 +131,16 @@ function getOptions(options = {}) {
|
|
|
152
131
|
isInclude,
|
|
153
132
|
classSetOutputOptions,
|
|
154
133
|
classMapOutputOptions,
|
|
155
|
-
twPatcher
|
|
134
|
+
twPatcher,
|
|
135
|
+
jsHandlerOptions: (options.jsHandlerOptions ?? {}),
|
|
136
|
+
htmlHandlerOptions: (options.htmlHandlerOptions ?? {}),
|
|
137
|
+
cssHandlerOptions: (options.cssHandlerOptions ?? {})
|
|
156
138
|
};
|
|
157
139
|
}
|
|
158
140
|
|
|
159
141
|
const outputCachedMap = new Map();
|
|
160
142
|
const unplugin = createUnplugin((options = {}, meta) => {
|
|
161
|
-
const { classGenerator, getCachedClassSet, isInclude, classMapOutputOptions } = getOptions(options);
|
|
143
|
+
const { classGenerator, getCachedClassSet, isInclude, classMapOutputOptions, htmlHandlerOptions, jsHandlerOptions, cssHandlerOptions } = getOptions(options);
|
|
162
144
|
return {
|
|
163
145
|
name: pluginName,
|
|
164
146
|
enforce: 'post',
|
|
@@ -175,6 +157,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
175
157
|
const [file, asset] = groupedEntries.html[i];
|
|
176
158
|
if (isInclude(file)) {
|
|
177
159
|
asset.source = htmlHandler(asset.source.toString(), {
|
|
160
|
+
...htmlHandlerOptions,
|
|
178
161
|
classGenerator,
|
|
179
162
|
runtimeSet
|
|
180
163
|
});
|
|
@@ -186,6 +169,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
186
169
|
const [file, chunk] = groupedEntries.js[i];
|
|
187
170
|
if (isInclude(file)) {
|
|
188
171
|
const code = jsHandler(chunk.code, {
|
|
172
|
+
...jsHandlerOptions,
|
|
189
173
|
runtimeSet,
|
|
190
174
|
classGenerator
|
|
191
175
|
}).code;
|
|
@@ -200,6 +184,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
200
184
|
const [file, css] = groupedEntries.css[i];
|
|
201
185
|
if (isInclude(file)) {
|
|
202
186
|
css.source = cssHandler(css.source.toString(), {
|
|
187
|
+
...cssHandlerOptions,
|
|
203
188
|
classGenerator,
|
|
204
189
|
runtimeSet
|
|
205
190
|
});
|
|
@@ -277,6 +262,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
277
262
|
const [file, asset] = groupedEntries.html[i];
|
|
278
263
|
if (isInclude(file)) {
|
|
279
264
|
const html = htmlHandler(asset.source().toString(), {
|
|
265
|
+
...htmlHandlerOptions,
|
|
280
266
|
classGenerator,
|
|
281
267
|
runtimeSet
|
|
282
268
|
});
|
|
@@ -290,6 +276,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
290
276
|
const [file, chunk] = groupedEntries.js[i];
|
|
291
277
|
if (isInclude(file)) {
|
|
292
278
|
const code = jsHandler(chunk.source().toString(), {
|
|
279
|
+
...jsHandlerOptions,
|
|
293
280
|
runtimeSet,
|
|
294
281
|
classGenerator
|
|
295
282
|
}).code;
|
|
@@ -305,6 +292,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
305
292
|
const [file, css] = groupedEntries.css[i];
|
|
306
293
|
if (isInclude(file)) {
|
|
307
294
|
const newCss = cssHandler(css.source().toString(), {
|
|
295
|
+
...cssHandlerOptions,
|
|
308
296
|
classGenerator,
|
|
309
297
|
runtimeSet
|
|
310
298
|
});
|
|
@@ -318,6 +306,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
318
306
|
html.forEach((asset, file) => {
|
|
319
307
|
if (isInclude(file)) {
|
|
320
308
|
const html = htmlHandler(asset.source().toString(), {
|
|
309
|
+
...htmlHandlerOptions,
|
|
321
310
|
classGenerator,
|
|
322
311
|
runtimeSet
|
|
323
312
|
});
|
|
@@ -331,6 +320,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
331
320
|
if (isInclude(file)) {
|
|
332
321
|
const rawCode = chunk.source().toString();
|
|
333
322
|
const code = jsHandler(rawCode, {
|
|
323
|
+
...jsHandlerOptions,
|
|
334
324
|
runtimeSet,
|
|
335
325
|
classGenerator
|
|
336
326
|
}).code;
|
|
@@ -345,6 +335,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
345
335
|
css.forEach((style, file) => {
|
|
346
336
|
if (isInclude(file)) {
|
|
347
337
|
const newCss = cssHandler(style.source().toString(), {
|
|
338
|
+
...cssHandlerOptions,
|
|
348
339
|
classGenerator,
|
|
349
340
|
runtimeSet
|
|
350
341
|
});
|
package/dist/nuxt.js
CHANGED
package/dist/nuxt.mjs
CHANGED
package/dist/options.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Options, ClassSetOutputOptions, ClassMapOutputOptions } from './types';
|
|
2
2
|
import { TailwindcssPatcher } from 'tailwindcss-patch';
|
|
3
3
|
import { ClassGenerator } from 'tailwindcss-mangle-core';
|
|
4
|
+
import type { IHtmlHandlerOptions, IJsHandlerOptions, ICssHandlerOptions } from 'tailwindcss-mangle-core';
|
|
4
5
|
export declare function getOptions(options?: Options | undefined): {
|
|
5
6
|
getCachedClassSet: () => Set<string>;
|
|
6
7
|
classGenerator: ClassGenerator;
|
|
@@ -10,4 +11,7 @@ export declare function getOptions(options?: Options | undefined): {
|
|
|
10
11
|
classSetOutputOptions: ClassSetOutputOptions;
|
|
11
12
|
classMapOutputOptions: ClassMapOutputOptions;
|
|
12
13
|
twPatcher: TailwindcssPatcher;
|
|
14
|
+
jsHandlerOptions: IJsHandlerOptions;
|
|
15
|
+
htmlHandlerOptions: IHtmlHandlerOptions;
|
|
16
|
+
cssHandlerOptions: ICssHandlerOptions;
|
|
13
17
|
};
|
package/dist/rollup.js
CHANGED
package/dist/rollup.mjs
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { ClassGenerator } from 'tailwindcss-mangle-core';
|
|
2
|
-
export interface IClassGeneratorContextItem {
|
|
3
|
-
name: string;
|
|
4
|
-
usedBy: any[];
|
|
5
|
-
}
|
|
1
|
+
import type { ClassGenerator, IHtmlHandlerOptions, IJsHandlerOptions, ICssHandlerOptions } from 'tailwindcss-mangle-core';
|
|
6
2
|
export interface IClassGeneratorOptions {
|
|
7
3
|
reserveClassName?: (string | RegExp)[];
|
|
8
4
|
customGenerate?: (original: string, opts: IClassGeneratorOptions, context: Record<string, any>) => string | undefined;
|
|
@@ -12,18 +8,10 @@ export interface IClassGeneratorOptions {
|
|
|
12
8
|
ignoreClass?: (string | RegExp)[];
|
|
13
9
|
classPrefix?: string;
|
|
14
10
|
}
|
|
15
|
-
export interface IClassGenerator {
|
|
16
|
-
newClassMap: Record<string, IClassGeneratorContextItem>;
|
|
17
|
-
newClassSize: number;
|
|
18
|
-
context: Record<string, any>;
|
|
19
|
-
}
|
|
20
11
|
export interface IHandlerOptions {
|
|
21
12
|
runtimeSet: Set<string>;
|
|
22
13
|
classGenerator: ClassGenerator;
|
|
23
14
|
}
|
|
24
|
-
export interface ICssHandlerOptions extends IHandlerOptions {
|
|
25
|
-
scene?: 'loader' | 'process';
|
|
26
|
-
}
|
|
27
15
|
export interface ClassSetOutputOptions {
|
|
28
16
|
filename: string;
|
|
29
17
|
dir?: string;
|
|
@@ -34,9 +22,13 @@ export interface ClassMapOutputOptions {
|
|
|
34
22
|
dir?: string;
|
|
35
23
|
}
|
|
36
24
|
export interface Options {
|
|
25
|
+
mangleClassFilter?: (className: string) => boolean;
|
|
37
26
|
classGenerator?: IClassGeneratorOptions;
|
|
38
27
|
exclude?: string[];
|
|
39
28
|
include?: string[];
|
|
40
29
|
classSetOutput?: boolean | ClassSetOutputOptions;
|
|
41
30
|
classMapOutput?: boolean | ClassMapOutputOptions;
|
|
31
|
+
htmlHandlerOptions?: IHtmlHandlerOptions;
|
|
32
|
+
jsHandlerOptions?: IJsHandlerOptions;
|
|
33
|
+
cssHandlerOptions?: ICssHandlerOptions;
|
|
42
34
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
export declare function groupBy<T>(arr: T[], cb: (arg: T) => string): Record<string, T[]>;
|
|
1
|
+
import { defaultMangleClassFilter, isMap, isRegexp } from 'tailwindcss-mangle-shared';
|
|
2
|
+
export { defaultMangleClassFilter, isMap, isRegexp };
|
|
4
3
|
export declare function getGroupedEntries<T>(entries: [string, T][], options?: {
|
|
5
4
|
cssMatcher(file: string): boolean;
|
|
6
5
|
htmlMatcher(file: string): boolean;
|
|
7
6
|
jsMatcher(file: string): boolean;
|
|
8
7
|
}): Record<"css" | "html" | "js" | "other", [string, T][]>;
|
|
9
|
-
export declare const acceptChars: string[];
|
|
10
|
-
export declare function stripEscapeSequence(words: string): string;
|
|
11
|
-
export declare const validate: (opts: IClassGeneratorOptions, classGenerator: IClassGenerator) => void;
|
|
12
|
-
export declare function isRegexp(value: unknown): boolean;
|
|
13
|
-
export declare function isMap(value: unknown): boolean;
|
|
14
|
-
export declare function regExpTest(arr: (string | RegExp)[] | undefined, str: string): boolean;
|
|
15
|
-
export declare function escapeStringRegexp(str: string): string;
|
|
16
8
|
export declare function createGlobMatcher(pattern: string | string[] | undefined, fallbackValue?: boolean): (file: string) => boolean;
|
|
17
9
|
export declare function getCacheDir(basedir?: string): string;
|
|
18
10
|
export declare function mkCacheDirectory(cwd?: string): string;
|
package/dist/vite.js
CHANGED
package/dist/vite.mjs
CHANGED
package/dist/webpack.js
CHANGED
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-tailwindcss-mangle",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "mangle tailwindcss utilities class plugin. support vite and webpack!",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -62,8 +62,9 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"micromatch": "^4.0.5",
|
|
64
64
|
"unplugin": "^1.3.1",
|
|
65
|
-
"tailwindcss-mangle-core": "^1.
|
|
66
|
-
"tailwindcss-
|
|
65
|
+
"tailwindcss-mangle-core": "^1.2.2",
|
|
66
|
+
"tailwindcss-mangle-shared": "^1.2.2",
|
|
67
|
+
"tailwindcss-patch": "^1.2.2"
|
|
67
68
|
},
|
|
68
69
|
"publishConfig": {
|
|
69
70
|
"access": "public",
|
|
@@ -73,9 +74,9 @@
|
|
|
73
74
|
"@types/micromatch": "^4.0.2",
|
|
74
75
|
"simple-functional-loader": "^1.2.1",
|
|
75
76
|
"tailwindcss": "^3.3.2",
|
|
76
|
-
"tslib": "^2.5.
|
|
77
|
-
"vite": "^4.3.
|
|
78
|
-
"webpack": "^5.
|
|
77
|
+
"tslib": "^2.5.3",
|
|
78
|
+
"vite": "^4.3.9",
|
|
79
|
+
"webpack": "^5.85.1"
|
|
79
80
|
},
|
|
80
81
|
"homepage": "https://github.com/sonofmagic/tailwindcss-mangle",
|
|
81
82
|
"repository": {
|