@tailwindcss-mangle/config 5.1.2 → 6.0.0
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 +40 -22
- package/dist/index.d.cts +51 -44
- package/dist/index.d.ts +51 -44
- package/dist/index.js +38 -20
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -33,8 +33,8 @@ __export(index_exports, {
|
|
|
33
33
|
CONFIG_NAME: () => CONFIG_NAME,
|
|
34
34
|
defineConfig: () => defineConfig,
|
|
35
35
|
getConfig: () => getConfig,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
getDefaultRegistryConfig: () => getDefaultRegistryConfig,
|
|
37
|
+
getDefaultTransformerConfig: () => getDefaultTransformerConfig,
|
|
38
38
|
getDefaultUserConfig: () => getDefaultUserConfig,
|
|
39
39
|
initConfig: () => initConfig
|
|
40
40
|
});
|
|
@@ -57,35 +57,42 @@ var defaultPipelineInclude = [
|
|
|
57
57
|
import_is_css_request.CSS_LANGS_RE
|
|
58
58
|
];
|
|
59
59
|
var defaultPipelineExclude = [];
|
|
60
|
-
function
|
|
60
|
+
function getDefaultRegistryConfig() {
|
|
61
61
|
return {
|
|
62
62
|
output: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
file: ".tw-patch/tw-class-list.json",
|
|
64
|
+
stripUniversalSelector: true,
|
|
65
|
+
pretty: true
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
tailwind: {}
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function getDefaultTransformerConfig() {
|
|
71
71
|
return {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
filter: import_shared.defaultMangleClassFilter,
|
|
73
|
+
sources: {
|
|
74
|
+
include: defaultPipelineInclude,
|
|
75
|
+
exclude: defaultPipelineExclude
|
|
76
|
+
},
|
|
75
77
|
disabled: import_node_process.default.env.NODE_ENV === "development",
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
registry: {
|
|
79
|
+
file: ".tw-patch/tw-class-list.json",
|
|
80
|
+
mapping: {
|
|
81
|
+
enabled: false,
|
|
82
|
+
file: ".tw-patch/tw-map-list.json",
|
|
83
|
+
loose: true
|
|
84
|
+
}
|
|
81
85
|
},
|
|
82
|
-
|
|
86
|
+
preserve: {
|
|
87
|
+
functions: [],
|
|
88
|
+
classes: []
|
|
89
|
+
}
|
|
83
90
|
};
|
|
84
91
|
}
|
|
85
92
|
function getDefaultUserConfig() {
|
|
86
93
|
return {
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
registry: getDefaultRegistryConfig(),
|
|
95
|
+
transformer: getDefaultTransformerConfig()
|
|
89
96
|
};
|
|
90
97
|
}
|
|
91
98
|
|
|
@@ -105,7 +112,18 @@ function initConfig(cwd) {
|
|
|
105
112
|
import_pathe.default.resolve(cwd, `${CONFIG_NAME}.config.ts`),
|
|
106
113
|
`import { defineConfig } from 'tailwindcss-patch'
|
|
107
114
|
|
|
108
|
-
export default defineConfig({
|
|
115
|
+
export default defineConfig({
|
|
116
|
+
registry: {
|
|
117
|
+
output: {
|
|
118
|
+
file: '.tw-patch/tw-class-list.json',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
transformer: {
|
|
122
|
+
registry: {
|
|
123
|
+
file: '.tw-patch/tw-class-list.json',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
})
|
|
109
127
|
`,
|
|
110
128
|
"utf8"
|
|
111
129
|
);
|
|
@@ -115,8 +133,8 @@ export default defineConfig({})
|
|
|
115
133
|
CONFIG_NAME,
|
|
116
134
|
defineConfig,
|
|
117
135
|
getConfig,
|
|
118
|
-
|
|
119
|
-
|
|
136
|
+
getDefaultRegistryConfig,
|
|
137
|
+
getDefaultTransformerConfig,
|
|
120
138
|
getDefaultUserConfig,
|
|
121
139
|
initConfig
|
|
122
140
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -4,73 +4,80 @@ import { IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
|
|
|
4
4
|
import { SourceEntry } from '@tailwindcss/oxide';
|
|
5
5
|
import { PackageResolvingOptions } from 'local-pkg';
|
|
6
6
|
|
|
7
|
-
interface
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
interface TransformerMappingConfig {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
file?: string;
|
|
10
10
|
loose?: boolean;
|
|
11
11
|
}
|
|
12
|
-
interface
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
interface TransformerMappingEntry {
|
|
13
|
+
original: string;
|
|
14
|
+
mangled: string;
|
|
15
15
|
usedBy: string[];
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
type TransformerMappingOption = boolean | TransformerMappingConfig | ((entries: TransformerMappingEntry[]) => void);
|
|
18
|
+
interface TransformerRegistryOptions {
|
|
19
|
+
file?: string;
|
|
20
|
+
mapping?: TransformerMappingOption;
|
|
21
|
+
}
|
|
22
|
+
interface TransformerSourceOptions {
|
|
21
23
|
include?: FilterPattern;
|
|
22
|
-
|
|
23
|
-
classMapOutput?: boolean | ClassMapOutputOptions | ((json: ClassMapOutputItem[]) => void);
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
preserveFunction?: string[];
|
|
24
|
+
exclude?: FilterPattern;
|
|
26
25
|
}
|
|
27
|
-
interface
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
interface TransformerPreserveOptions {
|
|
27
|
+
functions?: string[];
|
|
28
|
+
classes?: string[];
|
|
30
29
|
}
|
|
31
|
-
interface
|
|
30
|
+
interface TransformerOptions {
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
filter?: (className: string) => boolean;
|
|
33
|
+
generator?: IClassGeneratorOptions;
|
|
34
|
+
sources?: TransformerSourceOptions;
|
|
35
|
+
registry?: TransformerRegistryOptions;
|
|
36
|
+
preserve?: TransformerPreserveOptions;
|
|
37
|
+
}
|
|
38
|
+
interface TailwindLocatorOptions {
|
|
32
39
|
cwd?: string;
|
|
33
40
|
config?: string;
|
|
34
41
|
}
|
|
35
|
-
interface
|
|
42
|
+
interface TailwindNextOptions {
|
|
36
43
|
sources?: SourceEntry[];
|
|
37
44
|
base?: string;
|
|
38
45
|
css?: string;
|
|
39
46
|
cssEntries?: string[];
|
|
40
47
|
}
|
|
41
|
-
interface
|
|
48
|
+
interface TailwindTargetOptions {
|
|
42
49
|
version?: 2 | 3 | 4;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
package?: string;
|
|
51
|
+
resolve?: PackageResolvingOptions;
|
|
52
|
+
legacy?: TailwindLocatorOptions;
|
|
53
|
+
classic?: TailwindLocatorOptions;
|
|
54
|
+
next?: TailwindNextOptions;
|
|
55
|
+
cwd?: string;
|
|
56
|
+
config?: string;
|
|
46
57
|
}
|
|
47
|
-
interface
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* @description remove * in output json
|
|
52
|
-
*/
|
|
53
|
-
removeUniversalSelector?: boolean;
|
|
58
|
+
interface RegistryOutputOptions {
|
|
59
|
+
file?: string;
|
|
60
|
+
pretty?: boolean | number;
|
|
61
|
+
stripUniversalSelector?: boolean;
|
|
54
62
|
}
|
|
55
|
-
interface
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
tailwindcss?: TailwindcssUserConfig;
|
|
59
|
-
resolve?: PackageResolvingOptions;
|
|
63
|
+
interface RegistryOptions {
|
|
64
|
+
output?: RegistryOutputOptions;
|
|
65
|
+
tailwind?: TailwindTargetOptions;
|
|
60
66
|
}
|
|
61
|
-
interface
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
interface TailwindcssMangleConfig {
|
|
68
|
+
registry?: RegistryOptions;
|
|
69
|
+
transformer?: TransformerOptions;
|
|
64
70
|
}
|
|
71
|
+
type UserConfig = TailwindcssMangleConfig;
|
|
65
72
|
|
|
66
|
-
declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<
|
|
67
|
-
declare const defineConfig: c12.DefineConfig<
|
|
73
|
+
declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>>;
|
|
74
|
+
declare const defineConfig: c12.DefineConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>;
|
|
68
75
|
declare function initConfig(cwd: string): Promise<void>;
|
|
69
76
|
|
|
70
77
|
declare const CONFIG_NAME = "tailwindcss-mangle";
|
|
71
78
|
|
|
72
|
-
declare function
|
|
73
|
-
declare function
|
|
74
|
-
declare function getDefaultUserConfig():
|
|
79
|
+
declare function getDefaultRegistryConfig(): RegistryOptions;
|
|
80
|
+
declare function getDefaultTransformerConfig(): TransformerOptions;
|
|
81
|
+
declare function getDefaultUserConfig(): TailwindcssMangleConfig;
|
|
75
82
|
|
|
76
|
-
export { CONFIG_NAME, type
|
|
83
|
+
export { CONFIG_NAME, type RegistryOptions, type RegistryOutputOptions, type TailwindLocatorOptions, type TailwindNextOptions, type TailwindTargetOptions, 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
|
@@ -4,73 +4,80 @@ import { IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
|
|
|
4
4
|
import { SourceEntry } from '@tailwindcss/oxide';
|
|
5
5
|
import { PackageResolvingOptions } from 'local-pkg';
|
|
6
6
|
|
|
7
|
-
interface
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
interface TransformerMappingConfig {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
file?: string;
|
|
10
10
|
loose?: boolean;
|
|
11
11
|
}
|
|
12
|
-
interface
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
interface TransformerMappingEntry {
|
|
13
|
+
original: string;
|
|
14
|
+
mangled: string;
|
|
15
15
|
usedBy: string[];
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
type TransformerMappingOption = boolean | TransformerMappingConfig | ((entries: TransformerMappingEntry[]) => void);
|
|
18
|
+
interface TransformerRegistryOptions {
|
|
19
|
+
file?: string;
|
|
20
|
+
mapping?: TransformerMappingOption;
|
|
21
|
+
}
|
|
22
|
+
interface TransformerSourceOptions {
|
|
21
23
|
include?: FilterPattern;
|
|
22
|
-
|
|
23
|
-
classMapOutput?: boolean | ClassMapOutputOptions | ((json: ClassMapOutputItem[]) => void);
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
preserveFunction?: string[];
|
|
24
|
+
exclude?: FilterPattern;
|
|
26
25
|
}
|
|
27
|
-
interface
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
interface TransformerPreserveOptions {
|
|
27
|
+
functions?: string[];
|
|
28
|
+
classes?: string[];
|
|
30
29
|
}
|
|
31
|
-
interface
|
|
30
|
+
interface TransformerOptions {
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
filter?: (className: string) => boolean;
|
|
33
|
+
generator?: IClassGeneratorOptions;
|
|
34
|
+
sources?: TransformerSourceOptions;
|
|
35
|
+
registry?: TransformerRegistryOptions;
|
|
36
|
+
preserve?: TransformerPreserveOptions;
|
|
37
|
+
}
|
|
38
|
+
interface TailwindLocatorOptions {
|
|
32
39
|
cwd?: string;
|
|
33
40
|
config?: string;
|
|
34
41
|
}
|
|
35
|
-
interface
|
|
42
|
+
interface TailwindNextOptions {
|
|
36
43
|
sources?: SourceEntry[];
|
|
37
44
|
base?: string;
|
|
38
45
|
css?: string;
|
|
39
46
|
cssEntries?: string[];
|
|
40
47
|
}
|
|
41
|
-
interface
|
|
48
|
+
interface TailwindTargetOptions {
|
|
42
49
|
version?: 2 | 3 | 4;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
package?: string;
|
|
51
|
+
resolve?: PackageResolvingOptions;
|
|
52
|
+
legacy?: TailwindLocatorOptions;
|
|
53
|
+
classic?: TailwindLocatorOptions;
|
|
54
|
+
next?: TailwindNextOptions;
|
|
55
|
+
cwd?: string;
|
|
56
|
+
config?: string;
|
|
46
57
|
}
|
|
47
|
-
interface
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* @description remove * in output json
|
|
52
|
-
*/
|
|
53
|
-
removeUniversalSelector?: boolean;
|
|
58
|
+
interface RegistryOutputOptions {
|
|
59
|
+
file?: string;
|
|
60
|
+
pretty?: boolean | number;
|
|
61
|
+
stripUniversalSelector?: boolean;
|
|
54
62
|
}
|
|
55
|
-
interface
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
tailwindcss?: TailwindcssUserConfig;
|
|
59
|
-
resolve?: PackageResolvingOptions;
|
|
63
|
+
interface RegistryOptions {
|
|
64
|
+
output?: RegistryOutputOptions;
|
|
65
|
+
tailwind?: TailwindTargetOptions;
|
|
60
66
|
}
|
|
61
|
-
interface
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
interface TailwindcssMangleConfig {
|
|
68
|
+
registry?: RegistryOptions;
|
|
69
|
+
transformer?: TransformerOptions;
|
|
64
70
|
}
|
|
71
|
+
type UserConfig = TailwindcssMangleConfig;
|
|
65
72
|
|
|
66
|
-
declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<
|
|
67
|
-
declare const defineConfig: c12.DefineConfig<
|
|
73
|
+
declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>>;
|
|
74
|
+
declare const defineConfig: c12.DefineConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>;
|
|
68
75
|
declare function initConfig(cwd: string): Promise<void>;
|
|
69
76
|
|
|
70
77
|
declare const CONFIG_NAME = "tailwindcss-mangle";
|
|
71
78
|
|
|
72
|
-
declare function
|
|
73
|
-
declare function
|
|
74
|
-
declare function getDefaultUserConfig():
|
|
79
|
+
declare function getDefaultRegistryConfig(): RegistryOptions;
|
|
80
|
+
declare function getDefaultTransformerConfig(): TransformerOptions;
|
|
81
|
+
declare function getDefaultUserConfig(): TailwindcssMangleConfig;
|
|
75
82
|
|
|
76
|
-
export { CONFIG_NAME, type
|
|
83
|
+
export { CONFIG_NAME, type RegistryOptions, type RegistryOutputOptions, type TailwindLocatorOptions, type TailwindNextOptions, type TailwindTargetOptions, 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
|
@@ -15,35 +15,42 @@ var defaultPipelineInclude = [
|
|
|
15
15
|
CSS_LANGS_RE
|
|
16
16
|
];
|
|
17
17
|
var defaultPipelineExclude = [];
|
|
18
|
-
function
|
|
18
|
+
function getDefaultRegistryConfig() {
|
|
19
19
|
return {
|
|
20
20
|
output: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
file: ".tw-patch/tw-class-list.json",
|
|
22
|
+
stripUniversalSelector: true,
|
|
23
|
+
pretty: true
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
tailwind: {}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function getDefaultTransformerConfig() {
|
|
29
29
|
return {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
filter: defaultMangleClassFilter,
|
|
31
|
+
sources: {
|
|
32
|
+
include: defaultPipelineInclude,
|
|
33
|
+
exclude: defaultPipelineExclude
|
|
34
|
+
},
|
|
33
35
|
disabled: process.env.NODE_ENV === "development",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
registry: {
|
|
37
|
+
file: ".tw-patch/tw-class-list.json",
|
|
38
|
+
mapping: {
|
|
39
|
+
enabled: false,
|
|
40
|
+
file: ".tw-patch/tw-map-list.json",
|
|
41
|
+
loose: true
|
|
42
|
+
}
|
|
39
43
|
},
|
|
40
|
-
|
|
44
|
+
preserve: {
|
|
45
|
+
functions: [],
|
|
46
|
+
classes: []
|
|
47
|
+
}
|
|
41
48
|
};
|
|
42
49
|
}
|
|
43
50
|
function getDefaultUserConfig() {
|
|
44
51
|
return {
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
registry: getDefaultRegistryConfig(),
|
|
53
|
+
transformer: getDefaultTransformerConfig()
|
|
47
54
|
};
|
|
48
55
|
}
|
|
49
56
|
|
|
@@ -63,7 +70,18 @@ function initConfig(cwd) {
|
|
|
63
70
|
path.resolve(cwd, `${CONFIG_NAME}.config.ts`),
|
|
64
71
|
`import { defineConfig } from 'tailwindcss-patch'
|
|
65
72
|
|
|
66
|
-
export default defineConfig({
|
|
73
|
+
export default defineConfig({
|
|
74
|
+
registry: {
|
|
75
|
+
output: {
|
|
76
|
+
file: '.tw-patch/tw-class-list.json',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
transformer: {
|
|
80
|
+
registry: {
|
|
81
|
+
file: '.tw-patch/tw-class-list.json',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
})
|
|
67
85
|
`,
|
|
68
86
|
"utf8"
|
|
69
87
|
);
|
|
@@ -72,8 +90,8 @@ export {
|
|
|
72
90
|
CONFIG_NAME,
|
|
73
91
|
defineConfig,
|
|
74
92
|
getConfig,
|
|
75
|
-
|
|
76
|
-
|
|
93
|
+
getDefaultRegistryConfig,
|
|
94
|
+
getDefaultTransformerConfig,
|
|
77
95
|
getDefaultUserConfig,
|
|
78
96
|
initConfig
|
|
79
97
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailwindcss-mangle/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"description": "The config and load function of tailwindcss-mangle",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"c12": "^
|
|
52
|
+
"c12": "^3.3.1",
|
|
53
53
|
"fs-extra": "^11.3.2",
|
|
54
54
|
"is-css-request": "^1.0.1",
|
|
55
55
|
"pathe": "^2.0.3",
|