mantine-reduce-css 1.1.2 → 2.3.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/README.md +80 -19
- package/dist/index.js +9283 -1659
- package/package.json +45 -29
package/README.md
CHANGED
|
@@ -1,45 +1,106 @@
|
|
|
1
1
|
# mantine-reduce-css
|
|
2
2
|
|
|
3
|
-
A CLI tool
|
|
3
|
+
A CLI tool for generating reduced Mantine CSS bundles based on your project’s component usage.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
> This package supports Mantine v8.1.0 and above (it probably works with earlier versions, but is not tested).
|
|
7
|
-
> The current mantine version is `8.1.3`.
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
5
|
+
## Installation
|
|
10
6
|
|
|
11
7
|
```sh
|
|
12
|
-
|
|
8
|
+
npm install -g mantine-reduce-css
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
## Mantine Version
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Since version 2, this package follows Mantine's minor version updates.
|
|
14
|
+
Example: `mantine-reduce-css@2.3.x` is compatible with `@mantine/core@8.3.x`.
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Generate Reduced CSS
|
|
20
19
|
|
|
21
20
|
```sh
|
|
22
|
-
mantine-reduce-css
|
|
21
|
+
mantine-reduce-css --config <path-to-config>
|
|
23
22
|
```
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
### Export Component Data
|
|
25
|
+
|
|
26
|
+
To export component data for custom packages, use:
|
|
26
27
|
|
|
27
28
|
```sh
|
|
28
|
-
mantine-reduce-css
|
|
29
|
+
mantine-reduce-css gen --config <path-to-config>
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Add a `mantineReduceCss` section to your config file (e.g., `package.json` or a separate JSON file):
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mantineReduceCss": {
|
|
39
|
+
"target": [
|
|
40
|
+
"src/**/*.tsx"
|
|
41
|
+
],
|
|
42
|
+
"globalCss": true,
|
|
43
|
+
"extensions": {
|
|
44
|
+
"CodeHighlight": false,
|
|
45
|
+
"NotificationsSystem": false,
|
|
46
|
+
"Spotlight": false,
|
|
47
|
+
"Carousel": false,
|
|
48
|
+
"Dropzone": false,
|
|
49
|
+
"NavigationProgress": false,
|
|
50
|
+
"ModalsManager": false,
|
|
51
|
+
"RichTextEditor": false
|
|
52
|
+
},
|
|
53
|
+
"outputPath": "mantine.css",
|
|
54
|
+
"extend": [
|
|
55
|
+
{
|
|
56
|
+
"package": "@custom",
|
|
57
|
+
"data": "custom-components.json"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Options
|
|
65
|
+
|
|
66
|
+
- **target**: Array of glob patterns for files to scan for Mantine imports (required)
|
|
67
|
+
- **globalCss**: Include Mantine global CSS (default: true)
|
|
68
|
+
- **extensions**: Enable Mantine extension packages (all default to false)
|
|
69
|
+
- **outputPath**: Path to write the generated CSS file (required)
|
|
70
|
+
- **extend**: Array of objects to extend with custom component data (optional)
|
|
71
|
+
- **package**: Name of the custom package
|
|
72
|
+
- **data**: Path to a JSON file containing exported component data
|
|
73
|
+
|
|
74
|
+
### Export Config
|
|
75
|
+
|
|
76
|
+
For exporting component data, use:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mantineReduceCss": {
|
|
81
|
+
"target": [
|
|
82
|
+
"src/components/**/*.tsx"
|
|
83
|
+
],
|
|
84
|
+
"outputPath": "exported-components.json",
|
|
85
|
+
"packageName": "@custom"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Example
|
|
91
|
+
|
|
92
|
+
To generate CSS for your project:
|
|
32
93
|
|
|
33
94
|
```sh
|
|
34
|
-
mantine-reduce-css
|
|
95
|
+
mantine-reduce-css --config test/test-simple.json
|
|
35
96
|
```
|
|
36
97
|
|
|
37
|
-
|
|
98
|
+
To export component data:
|
|
38
99
|
|
|
39
100
|
```sh
|
|
40
|
-
mantine-reduce-css
|
|
101
|
+
mantine-reduce-css gen --config test/test-export.json
|
|
41
102
|
```
|
|
42
103
|
|
|
43
|
-
|
|
104
|
+
## License
|
|
44
105
|
|
|
45
|
-
|
|
106
|
+
MIT
|