@tailwindcss-mangle/config 6.1.0 → 6.1.1
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 +8 -3
- package/dist/index.d.cts +49 -2
- package/dist/index.d.ts +49 -2
- package/dist/index.js +8 -3
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -58,11 +58,15 @@ var defaultPipelineInclude = [
|
|
|
58
58
|
var defaultPipelineExclude = [];
|
|
59
59
|
function getDefaultRegistryConfig() {
|
|
60
60
|
return {
|
|
61
|
+
extract: {
|
|
62
|
+
file: ".tw-patch/tw-class-list.json"
|
|
63
|
+
},
|
|
61
64
|
output: {
|
|
62
65
|
file: ".tw-patch/tw-class-list.json",
|
|
63
66
|
stripUniversalSelector: true,
|
|
64
67
|
pretty: true
|
|
65
68
|
},
|
|
69
|
+
tailwindcss: {},
|
|
66
70
|
tailwind: {}
|
|
67
71
|
};
|
|
68
72
|
}
|
|
@@ -73,7 +77,7 @@ function getDefaultTransformerConfig() {
|
|
|
73
77
|
include: defaultPipelineInclude,
|
|
74
78
|
exclude: defaultPipelineExclude
|
|
75
79
|
},
|
|
76
|
-
disabled: import_node_process.default.env
|
|
80
|
+
disabled: import_node_process.default.env["NODE_ENV"] === "development",
|
|
77
81
|
registry: {
|
|
78
82
|
file: ".tw-patch/tw-class-list.json",
|
|
79
83
|
mapping: {
|
|
@@ -110,7 +114,7 @@ async function getConfig(cwd) {
|
|
|
110
114
|
defaults: {
|
|
111
115
|
...getDefaultUserConfig()
|
|
112
116
|
},
|
|
113
|
-
cwd
|
|
117
|
+
...cwd === void 0 ? {} : { cwd }
|
|
114
118
|
});
|
|
115
119
|
}
|
|
116
120
|
var defineConfig = (config) => config;
|
|
@@ -121,9 +125,10 @@ function initConfig(cwd) {
|
|
|
121
125
|
|
|
122
126
|
export default defineConfig({
|
|
123
127
|
registry: {
|
|
124
|
-
|
|
128
|
+
extract: {
|
|
125
129
|
file: '.tw-patch/tw-class-list.json',
|
|
126
130
|
},
|
|
131
|
+
tailwindcss: {},
|
|
127
132
|
},
|
|
128
133
|
transformer: {
|
|
129
134
|
registry: {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createDefineConfig, ResolvedConfig } from 'c12';
|
|
2
2
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
3
3
|
import { IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
|
|
4
4
|
import { SourceEntry } from '@tailwindcss/oxide';
|
|
@@ -45,12 +45,51 @@ interface TailwindNextOptions {
|
|
|
45
45
|
css?: string;
|
|
46
46
|
cssEntries?: string[];
|
|
47
47
|
}
|
|
48
|
+
interface RegistryExposeContextOptions {
|
|
49
|
+
refProperty?: string;
|
|
50
|
+
}
|
|
51
|
+
interface RegistryExtendLengthUnitsOptions {
|
|
52
|
+
enabled?: boolean;
|
|
53
|
+
units?: string[];
|
|
54
|
+
lengthUnitsFilePath?: string;
|
|
55
|
+
variableName?: string;
|
|
56
|
+
overwrite?: boolean;
|
|
57
|
+
destPath?: string;
|
|
58
|
+
}
|
|
59
|
+
interface RegistryApplyOptions {
|
|
60
|
+
overwrite?: boolean;
|
|
61
|
+
exposeContext?: boolean | RegistryExposeContextOptions;
|
|
62
|
+
extendLengthUnits?: false | RegistryExtendLengthUnitsOptions;
|
|
63
|
+
}
|
|
64
|
+
interface RegistryExtractOptions {
|
|
65
|
+
write?: boolean;
|
|
66
|
+
file?: string;
|
|
67
|
+
format?: 'json' | 'lines';
|
|
68
|
+
pretty?: boolean | number;
|
|
69
|
+
removeUniversalSelector?: boolean;
|
|
70
|
+
}
|
|
71
|
+
interface RegistryCacheOptions {
|
|
72
|
+
enabled?: boolean;
|
|
73
|
+
cwd?: string;
|
|
74
|
+
dir?: string;
|
|
75
|
+
file?: string;
|
|
76
|
+
strategy?: 'merge' | 'overwrite';
|
|
77
|
+
driver?: 'file' | 'memory' | 'noop';
|
|
78
|
+
}
|
|
48
79
|
interface TailwindTargetOptions {
|
|
49
80
|
version?: 2 | 3 | 4;
|
|
81
|
+
packageName?: string;
|
|
82
|
+
/** @deprecated Use `packageName` instead. */
|
|
50
83
|
package?: string;
|
|
51
84
|
resolve?: PackageResolvingOptions;
|
|
85
|
+
v2?: TailwindLocatorOptions;
|
|
86
|
+
v3?: TailwindLocatorOptions;
|
|
87
|
+
v4?: TailwindNextOptions;
|
|
88
|
+
/** @deprecated Use `v2` instead. */
|
|
52
89
|
legacy?: TailwindLocatorOptions;
|
|
90
|
+
/** @deprecated Use `v3` instead. */
|
|
53
91
|
classic?: TailwindLocatorOptions;
|
|
92
|
+
/** @deprecated Use `v4` instead. */
|
|
54
93
|
next?: TailwindNextOptions;
|
|
55
94
|
cwd?: string;
|
|
56
95
|
config?: string;
|
|
@@ -61,7 +100,15 @@ interface RegistryOutputOptions {
|
|
|
61
100
|
stripUniversalSelector?: boolean;
|
|
62
101
|
}
|
|
63
102
|
interface RegistryOptions {
|
|
103
|
+
projectRoot?: string;
|
|
104
|
+
tailwindcss?: TailwindTargetOptions;
|
|
105
|
+
apply?: RegistryApplyOptions;
|
|
106
|
+
extract?: RegistryExtractOptions;
|
|
107
|
+
cache?: RegistryCacheOptions;
|
|
108
|
+
filter?: (className: string) => boolean;
|
|
109
|
+
/** @deprecated Use `extract` instead. */
|
|
64
110
|
output?: RegistryOutputOptions;
|
|
111
|
+
/** @deprecated Use `tailwindcss` instead. */
|
|
65
112
|
tailwind?: TailwindTargetOptions;
|
|
66
113
|
}
|
|
67
114
|
interface TailwindcssMangleConfig {
|
|
@@ -81,4 +128,4 @@ declare function getDefaultRegistryConfig(): RegistryOptions;
|
|
|
81
128
|
declare function getDefaultTransformerConfig(): TransformerOptions;
|
|
82
129
|
declare function getDefaultUserConfig(): TailwindcssMangleConfig;
|
|
83
130
|
|
|
84
|
-
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 };
|
|
131
|
+
export { CONFIG_NAME, type RegistryApplyOptions, type RegistryCacheOptions, type RegistryExposeContextOptions, type RegistryExtendLengthUnitsOptions, type RegistryExtractOptions, 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createDefineConfig, ResolvedConfig } from 'c12';
|
|
2
2
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
3
3
|
import { IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
|
|
4
4
|
import { SourceEntry } from '@tailwindcss/oxide';
|
|
@@ -45,12 +45,51 @@ interface TailwindNextOptions {
|
|
|
45
45
|
css?: string;
|
|
46
46
|
cssEntries?: string[];
|
|
47
47
|
}
|
|
48
|
+
interface RegistryExposeContextOptions {
|
|
49
|
+
refProperty?: string;
|
|
50
|
+
}
|
|
51
|
+
interface RegistryExtendLengthUnitsOptions {
|
|
52
|
+
enabled?: boolean;
|
|
53
|
+
units?: string[];
|
|
54
|
+
lengthUnitsFilePath?: string;
|
|
55
|
+
variableName?: string;
|
|
56
|
+
overwrite?: boolean;
|
|
57
|
+
destPath?: string;
|
|
58
|
+
}
|
|
59
|
+
interface RegistryApplyOptions {
|
|
60
|
+
overwrite?: boolean;
|
|
61
|
+
exposeContext?: boolean | RegistryExposeContextOptions;
|
|
62
|
+
extendLengthUnits?: false | RegistryExtendLengthUnitsOptions;
|
|
63
|
+
}
|
|
64
|
+
interface RegistryExtractOptions {
|
|
65
|
+
write?: boolean;
|
|
66
|
+
file?: string;
|
|
67
|
+
format?: 'json' | 'lines';
|
|
68
|
+
pretty?: boolean | number;
|
|
69
|
+
removeUniversalSelector?: boolean;
|
|
70
|
+
}
|
|
71
|
+
interface RegistryCacheOptions {
|
|
72
|
+
enabled?: boolean;
|
|
73
|
+
cwd?: string;
|
|
74
|
+
dir?: string;
|
|
75
|
+
file?: string;
|
|
76
|
+
strategy?: 'merge' | 'overwrite';
|
|
77
|
+
driver?: 'file' | 'memory' | 'noop';
|
|
78
|
+
}
|
|
48
79
|
interface TailwindTargetOptions {
|
|
49
80
|
version?: 2 | 3 | 4;
|
|
81
|
+
packageName?: string;
|
|
82
|
+
/** @deprecated Use `packageName` instead. */
|
|
50
83
|
package?: string;
|
|
51
84
|
resolve?: PackageResolvingOptions;
|
|
85
|
+
v2?: TailwindLocatorOptions;
|
|
86
|
+
v3?: TailwindLocatorOptions;
|
|
87
|
+
v4?: TailwindNextOptions;
|
|
88
|
+
/** @deprecated Use `v2` instead. */
|
|
52
89
|
legacy?: TailwindLocatorOptions;
|
|
90
|
+
/** @deprecated Use `v3` instead. */
|
|
53
91
|
classic?: TailwindLocatorOptions;
|
|
92
|
+
/** @deprecated Use `v4` instead. */
|
|
54
93
|
next?: TailwindNextOptions;
|
|
55
94
|
cwd?: string;
|
|
56
95
|
config?: string;
|
|
@@ -61,7 +100,15 @@ interface RegistryOutputOptions {
|
|
|
61
100
|
stripUniversalSelector?: boolean;
|
|
62
101
|
}
|
|
63
102
|
interface RegistryOptions {
|
|
103
|
+
projectRoot?: string;
|
|
104
|
+
tailwindcss?: TailwindTargetOptions;
|
|
105
|
+
apply?: RegistryApplyOptions;
|
|
106
|
+
extract?: RegistryExtractOptions;
|
|
107
|
+
cache?: RegistryCacheOptions;
|
|
108
|
+
filter?: (className: string) => boolean;
|
|
109
|
+
/** @deprecated Use `extract` instead. */
|
|
64
110
|
output?: RegistryOutputOptions;
|
|
111
|
+
/** @deprecated Use `tailwindcss` instead. */
|
|
65
112
|
tailwind?: TailwindTargetOptions;
|
|
66
113
|
}
|
|
67
114
|
interface TailwindcssMangleConfig {
|
|
@@ -81,4 +128,4 @@ declare function getDefaultRegistryConfig(): RegistryOptions;
|
|
|
81
128
|
declare function getDefaultTransformerConfig(): TransformerOptions;
|
|
82
129
|
declare function getDefaultUserConfig(): TailwindcssMangleConfig;
|
|
83
130
|
|
|
84
|
-
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 };
|
|
131
|
+
export { CONFIG_NAME, type RegistryApplyOptions, type RegistryCacheOptions, type RegistryExposeContextOptions, type RegistryExtendLengthUnitsOptions, type RegistryExtractOptions, 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
|
@@ -16,11 +16,15 @@ var defaultPipelineInclude = [
|
|
|
16
16
|
var defaultPipelineExclude = [];
|
|
17
17
|
function getDefaultRegistryConfig() {
|
|
18
18
|
return {
|
|
19
|
+
extract: {
|
|
20
|
+
file: ".tw-patch/tw-class-list.json"
|
|
21
|
+
},
|
|
19
22
|
output: {
|
|
20
23
|
file: ".tw-patch/tw-class-list.json",
|
|
21
24
|
stripUniversalSelector: true,
|
|
22
25
|
pretty: true
|
|
23
26
|
},
|
|
27
|
+
tailwindcss: {},
|
|
24
28
|
tailwind: {}
|
|
25
29
|
};
|
|
26
30
|
}
|
|
@@ -31,7 +35,7 @@ function getDefaultTransformerConfig() {
|
|
|
31
35
|
include: defaultPipelineInclude,
|
|
32
36
|
exclude: defaultPipelineExclude
|
|
33
37
|
},
|
|
34
|
-
disabled: process.env
|
|
38
|
+
disabled: process.env["NODE_ENV"] === "development",
|
|
35
39
|
registry: {
|
|
36
40
|
file: ".tw-patch/tw-class-list.json",
|
|
37
41
|
mapping: {
|
|
@@ -68,7 +72,7 @@ async function getConfig(cwd) {
|
|
|
68
72
|
defaults: {
|
|
69
73
|
...getDefaultUserConfig()
|
|
70
74
|
},
|
|
71
|
-
cwd
|
|
75
|
+
...cwd === void 0 ? {} : { cwd }
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
78
|
var defineConfig = (config) => config;
|
|
@@ -79,9 +83,10 @@ function initConfig(cwd) {
|
|
|
79
83
|
|
|
80
84
|
export default defineConfig({
|
|
81
85
|
registry: {
|
|
82
|
-
|
|
86
|
+
extract: {
|
|
83
87
|
file: '.tw-patch/tw-class-list.json',
|
|
84
88
|
},
|
|
89
|
+
tailwindcss: {},
|
|
85
90
|
},
|
|
86
91
|
transformer: {
|
|
87
92
|
registry: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailwindcss-mangle/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.1.
|
|
4
|
+
"version": "6.1.1",
|
|
5
5
|
"description": "The config and load function of tailwindcss-mangle",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"c12": "^3.3.
|
|
53
|
-
"fs-extra": "^11.3.
|
|
52
|
+
"c12": "^3.3.3",
|
|
53
|
+
"fs-extra": "^11.3.3",
|
|
54
54
|
"is-css-request": "^1.0.1",
|
|
55
55
|
"pathe": "^2.0.3",
|
|
56
56
|
"@tailwindcss-mangle/shared": "^4.1.1"
|