@tailwindcss-mangle/config 6.1.4-alpha.0 → 7.0.0-alpha.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/index.cjs +14 -11
- package/dist/index.d.cts +12 -25
- package/dist/index.d.ts +12 -25
- package/dist/index.js +13 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -49,30 +49,34 @@ var CONFIG_NAME = "tailwindcss-mangle";
|
|
|
49
49
|
|
|
50
50
|
// src/defaults.ts
|
|
51
51
|
var import_node_process = __toESM(require("process"), 1);
|
|
52
|
-
var import_shared = require("@tailwindcss-mangle/shared");
|
|
53
52
|
var import_is_css_request = require("is-css-request");
|
|
54
53
|
var defaultPipelineInclude = [
|
|
55
54
|
/\.(html|js|cjs|mjs|ts|cts|mts|jsx|tsx|vue|svelte|astro|elm|php|phtml|mdx|md)(?:$|\?)/,
|
|
56
55
|
import_is_css_request.CSS_LANGS_RE
|
|
57
56
|
];
|
|
58
57
|
var defaultPipelineExclude = [];
|
|
58
|
+
var preservedClassNames = /* @__PURE__ */ new Set([
|
|
59
|
+
"ease-out",
|
|
60
|
+
"ease-linear",
|
|
61
|
+
"ease-in",
|
|
62
|
+
"ease-in-out"
|
|
63
|
+
]);
|
|
64
|
+
function defaultMangleClassFilter(className) {
|
|
65
|
+
if (preservedClassNames.has(className)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return /[:-]/.test(className);
|
|
69
|
+
}
|
|
59
70
|
function getDefaultRegistryConfig() {
|
|
60
71
|
return {
|
|
61
72
|
extract: {
|
|
62
73
|
file: ".tw-patch/tw-class-list.json"
|
|
63
|
-
}
|
|
64
|
-
output: {
|
|
65
|
-
file: ".tw-patch/tw-class-list.json",
|
|
66
|
-
stripUniversalSelector: true,
|
|
67
|
-
pretty: true
|
|
68
|
-
},
|
|
69
|
-
tailwindcss: {},
|
|
70
|
-
tailwind: {}
|
|
74
|
+
}
|
|
71
75
|
};
|
|
72
76
|
}
|
|
73
77
|
function getDefaultTransformerConfig() {
|
|
74
78
|
return {
|
|
75
|
-
filter:
|
|
79
|
+
filter: defaultMangleClassFilter,
|
|
76
80
|
sources: {
|
|
77
81
|
include: defaultPipelineInclude,
|
|
78
82
|
exclude: defaultPipelineExclude
|
|
@@ -128,7 +132,6 @@ export default defineConfig({
|
|
|
128
132
|
extract: {
|
|
129
133
|
file: '.tw-patch/tw-class-list.json',
|
|
130
134
|
},
|
|
131
|
-
tailwindcss: {},
|
|
132
135
|
},
|
|
133
136
|
transformer: {
|
|
134
137
|
registry: {
|
package/dist/index.d.cts
CHANGED
|
@@ -35,11 +35,15 @@ interface TransformerOptions {
|
|
|
35
35
|
registry?: TransformerRegistryOptions;
|
|
36
36
|
preserve?: TransformerPreserveOptions;
|
|
37
37
|
}
|
|
38
|
-
interface
|
|
38
|
+
interface TailwindRuntimeOptionsBase {
|
|
39
39
|
cwd?: string;
|
|
40
40
|
config?: string;
|
|
41
41
|
}
|
|
42
|
-
interface
|
|
42
|
+
interface TailwindV2Options extends TailwindRuntimeOptionsBase {
|
|
43
|
+
}
|
|
44
|
+
interface TailwindV3Options extends TailwindRuntimeOptionsBase {
|
|
45
|
+
}
|
|
46
|
+
interface TailwindV4Options {
|
|
43
47
|
sources?: SourceEntry[];
|
|
44
48
|
base?: string;
|
|
45
49
|
css?: string;
|
|
@@ -76,40 +80,23 @@ interface RegistryCacheOptions {
|
|
|
76
80
|
strategy?: 'merge' | 'overwrite';
|
|
77
81
|
driver?: 'file' | 'memory' | 'noop';
|
|
78
82
|
}
|
|
79
|
-
interface
|
|
83
|
+
interface TailwindCssOptions {
|
|
80
84
|
version?: 2 | 3 | 4;
|
|
81
85
|
packageName?: string;
|
|
82
|
-
/** @deprecated Use `packageName` instead. */
|
|
83
|
-
package?: string;
|
|
84
86
|
resolve?: PackageResolvingOptions;
|
|
85
|
-
v2?:
|
|
86
|
-
v3?:
|
|
87
|
-
v4?:
|
|
88
|
-
/** @deprecated Use `v2` instead. */
|
|
89
|
-
legacy?: TailwindLocatorOptions;
|
|
90
|
-
/** @deprecated Use `v3` instead. */
|
|
91
|
-
classic?: TailwindLocatorOptions;
|
|
92
|
-
/** @deprecated Use `v4` instead. */
|
|
93
|
-
next?: TailwindNextOptions;
|
|
87
|
+
v2?: TailwindV2Options;
|
|
88
|
+
v3?: TailwindV3Options;
|
|
89
|
+
v4?: TailwindV4Options;
|
|
94
90
|
cwd?: string;
|
|
95
91
|
config?: string;
|
|
96
92
|
}
|
|
97
|
-
interface RegistryOutputOptions {
|
|
98
|
-
file?: string;
|
|
99
|
-
pretty?: boolean | number;
|
|
100
|
-
stripUniversalSelector?: boolean;
|
|
101
|
-
}
|
|
102
93
|
interface RegistryOptions {
|
|
103
94
|
projectRoot?: string;
|
|
104
|
-
tailwindcss?:
|
|
95
|
+
tailwindcss?: TailwindCssOptions;
|
|
105
96
|
apply?: RegistryApplyOptions;
|
|
106
97
|
extract?: RegistryExtractOptions;
|
|
107
98
|
cache?: RegistryCacheOptions;
|
|
108
99
|
filter?: (className: string) => boolean;
|
|
109
|
-
/** @deprecated Use `extract` instead. */
|
|
110
|
-
output?: RegistryOutputOptions;
|
|
111
|
-
/** @deprecated Use `tailwindcss` instead. */
|
|
112
|
-
tailwind?: TailwindTargetOptions;
|
|
113
100
|
}
|
|
114
101
|
interface TailwindcssMangleConfig {
|
|
115
102
|
registry?: RegistryOptions;
|
|
@@ -128,4 +115,4 @@ declare function getDefaultRegistryConfig(): RegistryOptions;
|
|
|
128
115
|
declare function getDefaultTransformerConfig(): TransformerOptions;
|
|
129
116
|
declare function getDefaultUserConfig(): TailwindcssMangleConfig;
|
|
130
117
|
|
|
131
|
-
export { CONFIG_NAME, type RegistryApplyOptions, type RegistryCacheOptions, type RegistryExposeContextOptions, type RegistryExtendLengthUnitsOptions, type RegistryExtractOptions, type RegistryOptions, type
|
|
118
|
+
export { CONFIG_NAME, type RegistryApplyOptions, type RegistryCacheOptions, type RegistryExposeContextOptions, type RegistryExtendLengthUnitsOptions, type RegistryExtractOptions, type RegistryOptions, type TailwindCssOptions, type TailwindV2Options, type TailwindV3Options, type TailwindV4Options, type TailwindcssMangleConfig, type TransformerMappingConfig, type TransformerMappingEntry, type TransformerMappingOption, type TransformerOptions, type TransformerPreserveOptions, type TransformerRegistryOptions, type TransformerSourceOptions, type UserConfig, defineConfig, getConfig, getDefaultRegistryConfig, getDefaultTransformerConfig, getDefaultUserConfig, initConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,11 +35,15 @@ interface TransformerOptions {
|
|
|
35
35
|
registry?: TransformerRegistryOptions;
|
|
36
36
|
preserve?: TransformerPreserveOptions;
|
|
37
37
|
}
|
|
38
|
-
interface
|
|
38
|
+
interface TailwindRuntimeOptionsBase {
|
|
39
39
|
cwd?: string;
|
|
40
40
|
config?: string;
|
|
41
41
|
}
|
|
42
|
-
interface
|
|
42
|
+
interface TailwindV2Options extends TailwindRuntimeOptionsBase {
|
|
43
|
+
}
|
|
44
|
+
interface TailwindV3Options extends TailwindRuntimeOptionsBase {
|
|
45
|
+
}
|
|
46
|
+
interface TailwindV4Options {
|
|
43
47
|
sources?: SourceEntry[];
|
|
44
48
|
base?: string;
|
|
45
49
|
css?: string;
|
|
@@ -76,40 +80,23 @@ interface RegistryCacheOptions {
|
|
|
76
80
|
strategy?: 'merge' | 'overwrite';
|
|
77
81
|
driver?: 'file' | 'memory' | 'noop';
|
|
78
82
|
}
|
|
79
|
-
interface
|
|
83
|
+
interface TailwindCssOptions {
|
|
80
84
|
version?: 2 | 3 | 4;
|
|
81
85
|
packageName?: string;
|
|
82
|
-
/** @deprecated Use `packageName` instead. */
|
|
83
|
-
package?: string;
|
|
84
86
|
resolve?: PackageResolvingOptions;
|
|
85
|
-
v2?:
|
|
86
|
-
v3?:
|
|
87
|
-
v4?:
|
|
88
|
-
/** @deprecated Use `v2` instead. */
|
|
89
|
-
legacy?: TailwindLocatorOptions;
|
|
90
|
-
/** @deprecated Use `v3` instead. */
|
|
91
|
-
classic?: TailwindLocatorOptions;
|
|
92
|
-
/** @deprecated Use `v4` instead. */
|
|
93
|
-
next?: TailwindNextOptions;
|
|
87
|
+
v2?: TailwindV2Options;
|
|
88
|
+
v3?: TailwindV3Options;
|
|
89
|
+
v4?: TailwindV4Options;
|
|
94
90
|
cwd?: string;
|
|
95
91
|
config?: string;
|
|
96
92
|
}
|
|
97
|
-
interface RegistryOutputOptions {
|
|
98
|
-
file?: string;
|
|
99
|
-
pretty?: boolean | number;
|
|
100
|
-
stripUniversalSelector?: boolean;
|
|
101
|
-
}
|
|
102
93
|
interface RegistryOptions {
|
|
103
94
|
projectRoot?: string;
|
|
104
|
-
tailwindcss?:
|
|
95
|
+
tailwindcss?: TailwindCssOptions;
|
|
105
96
|
apply?: RegistryApplyOptions;
|
|
106
97
|
extract?: RegistryExtractOptions;
|
|
107
98
|
cache?: RegistryCacheOptions;
|
|
108
99
|
filter?: (className: string) => boolean;
|
|
109
|
-
/** @deprecated Use `extract` instead. */
|
|
110
|
-
output?: RegistryOutputOptions;
|
|
111
|
-
/** @deprecated Use `tailwindcss` instead. */
|
|
112
|
-
tailwind?: TailwindTargetOptions;
|
|
113
100
|
}
|
|
114
101
|
interface TailwindcssMangleConfig {
|
|
115
102
|
registry?: RegistryOptions;
|
|
@@ -128,4 +115,4 @@ declare function getDefaultRegistryConfig(): RegistryOptions;
|
|
|
128
115
|
declare function getDefaultTransformerConfig(): TransformerOptions;
|
|
129
116
|
declare function getDefaultUserConfig(): TailwindcssMangleConfig;
|
|
130
117
|
|
|
131
|
-
export { CONFIG_NAME, type RegistryApplyOptions, type RegistryCacheOptions, type RegistryExposeContextOptions, type RegistryExtendLengthUnitsOptions, type RegistryExtractOptions, type RegistryOptions, type
|
|
118
|
+
export { CONFIG_NAME, type RegistryApplyOptions, type RegistryCacheOptions, type RegistryExposeContextOptions, type RegistryExtendLengthUnitsOptions, type RegistryExtractOptions, type RegistryOptions, type TailwindCssOptions, type TailwindV2Options, type TailwindV3Options, type TailwindV4Options, type TailwindcssMangleConfig, type TransformerMappingConfig, type TransformerMappingEntry, type TransformerMappingOption, type TransformerOptions, type TransformerPreserveOptions, type TransformerRegistryOptions, type TransformerSourceOptions, type UserConfig, defineConfig, getConfig, getDefaultRegistryConfig, getDefaultTransformerConfig, getDefaultUserConfig, initConfig };
|
package/dist/index.js
CHANGED
|
@@ -7,25 +7,29 @@ var CONFIG_NAME = "tailwindcss-mangle";
|
|
|
7
7
|
|
|
8
8
|
// src/defaults.ts
|
|
9
9
|
import process from "process";
|
|
10
|
-
import { defaultMangleClassFilter } from "@tailwindcss-mangle/shared";
|
|
11
10
|
import { CSS_LANGS_RE } from "is-css-request";
|
|
12
11
|
var defaultPipelineInclude = [
|
|
13
12
|
/\.(html|js|cjs|mjs|ts|cts|mts|jsx|tsx|vue|svelte|astro|elm|php|phtml|mdx|md)(?:$|\?)/,
|
|
14
13
|
CSS_LANGS_RE
|
|
15
14
|
];
|
|
16
15
|
var defaultPipelineExclude = [];
|
|
16
|
+
var preservedClassNames = /* @__PURE__ */ new Set([
|
|
17
|
+
"ease-out",
|
|
18
|
+
"ease-linear",
|
|
19
|
+
"ease-in",
|
|
20
|
+
"ease-in-out"
|
|
21
|
+
]);
|
|
22
|
+
function defaultMangleClassFilter(className) {
|
|
23
|
+
if (preservedClassNames.has(className)) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return /[:-]/.test(className);
|
|
27
|
+
}
|
|
17
28
|
function getDefaultRegistryConfig() {
|
|
18
29
|
return {
|
|
19
30
|
extract: {
|
|
20
31
|
file: ".tw-patch/tw-class-list.json"
|
|
21
|
-
}
|
|
22
|
-
output: {
|
|
23
|
-
file: ".tw-patch/tw-class-list.json",
|
|
24
|
-
stripUniversalSelector: true,
|
|
25
|
-
pretty: true
|
|
26
|
-
},
|
|
27
|
-
tailwindcss: {},
|
|
28
|
-
tailwind: {}
|
|
32
|
+
}
|
|
29
33
|
};
|
|
30
34
|
}
|
|
31
35
|
function getDefaultTransformerConfig() {
|
|
@@ -86,7 +90,6 @@ export default defineConfig({
|
|
|
86
90
|
extract: {
|
|
87
91
|
file: '.tw-patch/tw-class-list.json',
|
|
88
92
|
},
|
|
89
|
-
tailwindcss: {},
|
|
90
93
|
},
|
|
91
94
|
transformer: {
|
|
92
95
|
registry: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailwindcss-mangle/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0-alpha.2",
|
|
5
5
|
"description": "The config and load function of tailwindcss-mangle",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"fs-extra": "^11.3.4",
|
|
54
54
|
"is-css-request": "^1.0.1",
|
|
55
55
|
"pathe": "^2.0.3",
|
|
56
|
-
"@tailwindcss-mangle/shared": "^4.1.
|
|
56
|
+
"@tailwindcss-mangle/shared": "^4.1.4-alpha.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "tsup --watch --sourcemap",
|