@tailwindcss-mangle/config 4.0.1 → 5.0.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 -8
- package/dist/index.d.cts +29 -6
- package/dist/index.d.ts +29 -6
- package/dist/index.js +4 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -28,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
CONFIG_NAME: () => CONFIG_NAME,
|
|
34
34
|
defineConfig: () => defineConfig,
|
|
35
35
|
getConfig: () => getConfig,
|
|
36
36
|
getDefaultMangleUserConfig: () => getDefaultMangleUserConfig,
|
|
@@ -38,7 +38,7 @@ __export(src_exports, {
|
|
|
38
38
|
getDefaultUserConfig: () => getDefaultUserConfig,
|
|
39
39
|
initConfig: () => initConfig
|
|
40
40
|
});
|
|
41
|
-
module.exports = __toCommonJS(
|
|
41
|
+
module.exports = __toCommonJS(index_exports);
|
|
42
42
|
|
|
43
43
|
// src/config.ts
|
|
44
44
|
var import_c12 = require("c12");
|
|
@@ -46,7 +46,7 @@ var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
|
46
46
|
var import_pathe = __toESM(require("pathe"), 1);
|
|
47
47
|
|
|
48
48
|
// src/constants.ts
|
|
49
|
-
var
|
|
49
|
+
var CONFIG_NAME = "tailwindcss-mangle";
|
|
50
50
|
|
|
51
51
|
// src/defaults.ts
|
|
52
52
|
var import_node_process = __toESM(require("process"), 1);
|
|
@@ -92,7 +92,7 @@ function getDefaultUserConfig() {
|
|
|
92
92
|
// src/config.ts
|
|
93
93
|
function getConfig(cwd) {
|
|
94
94
|
return (0, import_c12.loadConfig)({
|
|
95
|
-
name:
|
|
95
|
+
name: CONFIG_NAME,
|
|
96
96
|
defaults: {
|
|
97
97
|
...getDefaultUserConfig()
|
|
98
98
|
},
|
|
@@ -102,7 +102,7 @@ function getConfig(cwd) {
|
|
|
102
102
|
var defineConfig = (0, import_c12.createDefineConfig)();
|
|
103
103
|
function initConfig(cwd) {
|
|
104
104
|
return import_fs_extra.default.outputFile(
|
|
105
|
-
import_pathe.default.resolve(cwd, `${
|
|
105
|
+
import_pathe.default.resolve(cwd, `${CONFIG_NAME}.config.ts`),
|
|
106
106
|
`import { defineConfig } from 'tailwindcss-patch'
|
|
107
107
|
|
|
108
108
|
export default defineConfig({})
|
|
@@ -112,7 +112,7 @@ export default defineConfig({})
|
|
|
112
112
|
}
|
|
113
113
|
// Annotate the CommonJS export names for ESM import in node:
|
|
114
114
|
0 && (module.exports = {
|
|
115
|
-
|
|
115
|
+
CONFIG_NAME,
|
|
116
116
|
defineConfig,
|
|
117
117
|
getConfig,
|
|
118
118
|
getDefaultMangleUserConfig,
|
package/dist/index.d.cts
CHANGED
|
@@ -22,6 +22,32 @@ interface MangleUserConfig {
|
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
preserveFunction?: string[];
|
|
24
24
|
}
|
|
25
|
+
interface TailwindcssV2PatchConfig {
|
|
26
|
+
cwd?: string;
|
|
27
|
+
config?: string;
|
|
28
|
+
}
|
|
29
|
+
interface TailwindcssV3PatchConfig {
|
|
30
|
+
cwd?: string;
|
|
31
|
+
config?: string;
|
|
32
|
+
}
|
|
33
|
+
interface GlobEntry {
|
|
34
|
+
/** Base path of the glob */
|
|
35
|
+
base?: string;
|
|
36
|
+
/** Glob pattern */
|
|
37
|
+
pattern: string;
|
|
38
|
+
}
|
|
39
|
+
interface TailwindcssV4PatchConfig {
|
|
40
|
+
sources?: GlobEntry[];
|
|
41
|
+
base?: string;
|
|
42
|
+
css?: string;
|
|
43
|
+
cssEntries?: string[];
|
|
44
|
+
}
|
|
45
|
+
interface TailwindcssUserConfig {
|
|
46
|
+
version?: 2 | 3 | 4;
|
|
47
|
+
v2?: TailwindcssV2PatchConfig;
|
|
48
|
+
v3?: TailwindcssV3PatchConfig;
|
|
49
|
+
v4?: TailwindcssV4PatchConfig;
|
|
50
|
+
}
|
|
25
51
|
interface PatchUserConfig {
|
|
26
52
|
output?: {
|
|
27
53
|
filename?: string;
|
|
@@ -31,10 +57,7 @@ interface PatchUserConfig {
|
|
|
31
57
|
*/
|
|
32
58
|
removeUniversalSelector?: boolean;
|
|
33
59
|
};
|
|
34
|
-
tailwindcss?:
|
|
35
|
-
cwd?: string;
|
|
36
|
-
config?: string;
|
|
37
|
-
};
|
|
60
|
+
tailwindcss?: TailwindcssUserConfig;
|
|
38
61
|
}
|
|
39
62
|
interface UserConfig {
|
|
40
63
|
patch?: PatchUserConfig;
|
|
@@ -45,10 +68,10 @@ declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<UserConfig,
|
|
|
45
68
|
declare const defineConfig: c12.DefineConfig<UserConfig, c12.ConfigLayerMeta>;
|
|
46
69
|
declare function initConfig(cwd: string): Promise<void>;
|
|
47
70
|
|
|
48
|
-
declare const
|
|
71
|
+
declare const CONFIG_NAME = "tailwindcss-mangle";
|
|
49
72
|
|
|
50
73
|
declare function getDefaultPatchConfig(): PatchUserConfig;
|
|
51
74
|
declare function getDefaultMangleUserConfig(): MangleUserConfig;
|
|
52
75
|
declare function getDefaultUserConfig(): UserConfig;
|
|
53
76
|
|
|
54
|
-
export { type ClassMapOutputItem, type ClassMapOutputOptions, type MangleUserConfig, type PatchUserConfig, type
|
|
77
|
+
export { CONFIG_NAME, type ClassMapOutputItem, type ClassMapOutputOptions, type GlobEntry, type MangleUserConfig, type PatchUserConfig, type TailwindcssUserConfig, type TailwindcssV2PatchConfig, type TailwindcssV3PatchConfig, type TailwindcssV4PatchConfig, type UserConfig, defineConfig, getConfig, getDefaultMangleUserConfig, getDefaultPatchConfig, getDefaultUserConfig, initConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,32 @@ interface MangleUserConfig {
|
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
preserveFunction?: string[];
|
|
24
24
|
}
|
|
25
|
+
interface TailwindcssV2PatchConfig {
|
|
26
|
+
cwd?: string;
|
|
27
|
+
config?: string;
|
|
28
|
+
}
|
|
29
|
+
interface TailwindcssV3PatchConfig {
|
|
30
|
+
cwd?: string;
|
|
31
|
+
config?: string;
|
|
32
|
+
}
|
|
33
|
+
interface GlobEntry {
|
|
34
|
+
/** Base path of the glob */
|
|
35
|
+
base?: string;
|
|
36
|
+
/** Glob pattern */
|
|
37
|
+
pattern: string;
|
|
38
|
+
}
|
|
39
|
+
interface TailwindcssV4PatchConfig {
|
|
40
|
+
sources?: GlobEntry[];
|
|
41
|
+
base?: string;
|
|
42
|
+
css?: string;
|
|
43
|
+
cssEntries?: string[];
|
|
44
|
+
}
|
|
45
|
+
interface TailwindcssUserConfig {
|
|
46
|
+
version?: 2 | 3 | 4;
|
|
47
|
+
v2?: TailwindcssV2PatchConfig;
|
|
48
|
+
v3?: TailwindcssV3PatchConfig;
|
|
49
|
+
v4?: TailwindcssV4PatchConfig;
|
|
50
|
+
}
|
|
25
51
|
interface PatchUserConfig {
|
|
26
52
|
output?: {
|
|
27
53
|
filename?: string;
|
|
@@ -31,10 +57,7 @@ interface PatchUserConfig {
|
|
|
31
57
|
*/
|
|
32
58
|
removeUniversalSelector?: boolean;
|
|
33
59
|
};
|
|
34
|
-
tailwindcss?:
|
|
35
|
-
cwd?: string;
|
|
36
|
-
config?: string;
|
|
37
|
-
};
|
|
60
|
+
tailwindcss?: TailwindcssUserConfig;
|
|
38
61
|
}
|
|
39
62
|
interface UserConfig {
|
|
40
63
|
patch?: PatchUserConfig;
|
|
@@ -45,10 +68,10 @@ declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<UserConfig,
|
|
|
45
68
|
declare const defineConfig: c12.DefineConfig<UserConfig, c12.ConfigLayerMeta>;
|
|
46
69
|
declare function initConfig(cwd: string): Promise<void>;
|
|
47
70
|
|
|
48
|
-
declare const
|
|
71
|
+
declare const CONFIG_NAME = "tailwindcss-mangle";
|
|
49
72
|
|
|
50
73
|
declare function getDefaultPatchConfig(): PatchUserConfig;
|
|
51
74
|
declare function getDefaultMangleUserConfig(): MangleUserConfig;
|
|
52
75
|
declare function getDefaultUserConfig(): UserConfig;
|
|
53
76
|
|
|
54
|
-
export { type ClassMapOutputItem, type ClassMapOutputOptions, type MangleUserConfig, type PatchUserConfig, type
|
|
77
|
+
export { CONFIG_NAME, type ClassMapOutputItem, type ClassMapOutputOptions, type GlobEntry, type MangleUserConfig, type PatchUserConfig, type TailwindcssUserConfig, type TailwindcssV2PatchConfig, type TailwindcssV3PatchConfig, type TailwindcssV4PatchConfig, type UserConfig, defineConfig, getConfig, getDefaultMangleUserConfig, getDefaultPatchConfig, getDefaultUserConfig, initConfig };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import fs from "fs-extra";
|
|
|
4
4
|
import path from "pathe";
|
|
5
5
|
|
|
6
6
|
// src/constants.ts
|
|
7
|
-
var
|
|
7
|
+
var CONFIG_NAME = "tailwindcss-mangle";
|
|
8
8
|
|
|
9
9
|
// src/defaults.ts
|
|
10
10
|
import process from "node:process";
|
|
@@ -50,7 +50,7 @@ function getDefaultUserConfig() {
|
|
|
50
50
|
// src/config.ts
|
|
51
51
|
function getConfig(cwd) {
|
|
52
52
|
return loadConfig({
|
|
53
|
-
name:
|
|
53
|
+
name: CONFIG_NAME,
|
|
54
54
|
defaults: {
|
|
55
55
|
...getDefaultUserConfig()
|
|
56
56
|
},
|
|
@@ -60,7 +60,7 @@ function getConfig(cwd) {
|
|
|
60
60
|
var defineConfig = createDefineConfig();
|
|
61
61
|
function initConfig(cwd) {
|
|
62
62
|
return fs.outputFile(
|
|
63
|
-
path.resolve(cwd, `${
|
|
63
|
+
path.resolve(cwd, `${CONFIG_NAME}.config.ts`),
|
|
64
64
|
`import { defineConfig } from 'tailwindcss-patch'
|
|
65
65
|
|
|
66
66
|
export default defineConfig({})
|
|
@@ -69,7 +69,7 @@ export default defineConfig({})
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
CONFIG_NAME,
|
|
73
73
|
defineConfig,
|
|
74
74
|
getConfig,
|
|
75
75
|
getDefaultMangleUserConfig,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailwindcss-mangle/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.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,10 +49,10 @@
|
|
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"c12": "^2.0.
|
|
53
|
-
"fs-extra": "^11.
|
|
52
|
+
"c12": "^2.0.2",
|
|
53
|
+
"fs-extra": "^11.3.0",
|
|
54
54
|
"is-css-request": "^1.0.1",
|
|
55
|
-
"pathe": "^
|
|
55
|
+
"pathe": "^2.0.3",
|
|
56
56
|
"@tailwindcss-mangle/shared": "^4.0.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|