@tailwindcss-mangle/config 1.0.1 → 2.1.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 +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.mjs +18 -2
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const path = require('node:path');
|
|
|
4
4
|
const fs = require('node:fs/promises');
|
|
5
5
|
const c12 = require('c12');
|
|
6
6
|
const dedent = require('dedent');
|
|
7
|
+
const shared = require('@tailwindcss-mangle/shared');
|
|
7
8
|
|
|
8
9
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
10
|
|
|
@@ -21,9 +22,24 @@ function getDefaultPatchConfig() {
|
|
|
21
22
|
tailwindcss: {}
|
|
22
23
|
};
|
|
23
24
|
}
|
|
25
|
+
function getDefaultMangleUserConfig() {
|
|
26
|
+
return {
|
|
27
|
+
mangleClassFilter: shared.defaultMangleClassFilter,
|
|
28
|
+
include: ["**/*.{js,jsx,ts,tsx,svelte,vue}"],
|
|
29
|
+
exclude: ["node_modules/**/*", "**/*.{css,scss,less,sass,postcss,html,htm}"],
|
|
30
|
+
disabled: process.env.NODE_ENV === "development",
|
|
31
|
+
classListPath: ".tw-patch/tw-class-list.json",
|
|
32
|
+
classMapOutput: {
|
|
33
|
+
enable: false,
|
|
34
|
+
filename: ".tw-patch/tw-map-list.json",
|
|
35
|
+
loose: true
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
24
39
|
function getDefaultUserConfig() {
|
|
25
40
|
return {
|
|
26
|
-
patch: getDefaultPatchConfig()
|
|
41
|
+
patch: getDefaultPatchConfig(),
|
|
42
|
+
mangle: getDefaultMangleUserConfig()
|
|
27
43
|
};
|
|
28
44
|
}
|
|
29
45
|
|
|
@@ -54,6 +70,7 @@ function initConfig(cwd) {
|
|
|
54
70
|
exports.configName = configName;
|
|
55
71
|
exports.defineConfig = defineConfig;
|
|
56
72
|
exports.getConfig = getConfig;
|
|
73
|
+
exports.getDefaultMangleUserConfig = getDefaultMangleUserConfig;
|
|
57
74
|
exports.getDefaultPatchConfig = getDefaultPatchConfig;
|
|
58
75
|
exports.getDefaultUserConfig = getDefaultUserConfig;
|
|
59
76
|
exports.initConfig = initConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import * as c12 from 'c12';
|
|
2
|
+
import { IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
|
|
2
3
|
|
|
4
|
+
interface ClassMapOutputOptions {
|
|
5
|
+
enable?: boolean;
|
|
6
|
+
filename?: string;
|
|
7
|
+
loose?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface MangleUserConfig {
|
|
10
|
+
mangleClassFilter?: (className: string) => boolean;
|
|
11
|
+
classGenerator?: IClassGeneratorOptions;
|
|
12
|
+
exclude?: string[];
|
|
13
|
+
include?: string[];
|
|
14
|
+
classListPath?: string;
|
|
15
|
+
classMapOutput?: ClassMapOutputOptions;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
3
18
|
interface PatchUserConfig {
|
|
4
19
|
output?: {
|
|
5
20
|
filename?: string;
|
|
@@ -16,6 +31,7 @@ interface PatchUserConfig {
|
|
|
16
31
|
}
|
|
17
32
|
interface UserConfig {
|
|
18
33
|
patch?: PatchUserConfig;
|
|
34
|
+
mangle?: MangleUserConfig;
|
|
19
35
|
}
|
|
20
36
|
|
|
21
37
|
declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<UserConfig, c12.ConfigLayerMeta>>;
|
|
@@ -23,8 +39,9 @@ declare const defineConfig: c12.DefineConfig<UserConfig, c12.ConfigLayerMeta>;
|
|
|
23
39
|
declare function initConfig(cwd: string): Promise<void>;
|
|
24
40
|
|
|
25
41
|
declare function getDefaultPatchConfig(): PatchUserConfig;
|
|
42
|
+
declare function getDefaultMangleUserConfig(): MangleUserConfig;
|
|
26
43
|
declare function getDefaultUserConfig(): UserConfig;
|
|
27
44
|
|
|
28
45
|
declare const configName = "tailwindcss-mangle";
|
|
29
46
|
|
|
30
|
-
export { PatchUserConfig, UserConfig, configName, defineConfig, getConfig, getDefaultPatchConfig, getDefaultUserConfig, initConfig };
|
|
47
|
+
export { ClassMapOutputOptions, MangleUserConfig, PatchUserConfig, UserConfig, configName, defineConfig, getConfig, getDefaultMangleUserConfig, getDefaultPatchConfig, getDefaultUserConfig, initConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import { createDefineConfig, loadConfig } from 'c12';
|
|
4
4
|
import dedent from 'dedent';
|
|
5
|
+
import { defaultMangleClassFilter } from '@tailwindcss-mangle/shared';
|
|
5
6
|
|
|
6
7
|
function getDefaultPatchConfig() {
|
|
7
8
|
return {
|
|
@@ -13,9 +14,24 @@ function getDefaultPatchConfig() {
|
|
|
13
14
|
tailwindcss: {}
|
|
14
15
|
};
|
|
15
16
|
}
|
|
17
|
+
function getDefaultMangleUserConfig() {
|
|
18
|
+
return {
|
|
19
|
+
mangleClassFilter: defaultMangleClassFilter,
|
|
20
|
+
include: ["**/*.{js,jsx,ts,tsx,svelte,vue}"],
|
|
21
|
+
exclude: ["node_modules/**/*", "**/*.{css,scss,less,sass,postcss,html,htm}"],
|
|
22
|
+
disabled: process.env.NODE_ENV === "development",
|
|
23
|
+
classListPath: ".tw-patch/tw-class-list.json",
|
|
24
|
+
classMapOutput: {
|
|
25
|
+
enable: false,
|
|
26
|
+
filename: ".tw-patch/tw-map-list.json",
|
|
27
|
+
loose: true
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
16
31
|
function getDefaultUserConfig() {
|
|
17
32
|
return {
|
|
18
|
-
patch: getDefaultPatchConfig()
|
|
33
|
+
patch: getDefaultPatchConfig(),
|
|
34
|
+
mangle: getDefaultMangleUserConfig()
|
|
19
35
|
};
|
|
20
36
|
}
|
|
21
37
|
|
|
@@ -43,4 +59,4 @@ function initConfig(cwd) {
|
|
|
43
59
|
);
|
|
44
60
|
}
|
|
45
61
|
|
|
46
|
-
export { configName, defineConfig, getConfig, getDefaultPatchConfig, getDefaultUserConfig, initConfig };
|
|
62
|
+
export { configName, defineConfig, getConfig, getDefaultMangleUserConfig, getDefaultPatchConfig, getDefaultUserConfig, initConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailwindcss-mangle/config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "The config and load function of tailwindcss-mangle",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"c12": "^1.4.2",
|
|
43
|
-
"dedent": "^1.5.1"
|
|
43
|
+
"dedent": "^1.5.1",
|
|
44
|
+
"@tailwindcss-mangle/shared": "^2.1.0"
|
|
44
45
|
},
|
|
45
46
|
"homepage": "https://github.com/sonofmagic/tailwindcss-mangle",
|
|
46
47
|
"repository": {
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
},
|
|
50
51
|
"scripts": {
|
|
51
52
|
"build": "unbuild",
|
|
52
|
-
"test": "vitest run",
|
|
53
|
+
"test": "vitest run --coverage.enabled",
|
|
53
54
|
"test:dev": "vitest"
|
|
54
55
|
}
|
|
55
56
|
}
|