ultimate-jekyll-manager 0.0.231 → 0.0.232
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/CLAUDE.md
CHANGED
|
@@ -36,6 +36,27 @@ FIREBASE_EMULATOR_CONNECT=true npm start
|
|
|
36
36
|
|
|
37
37
|
This value is written to `.temp/_config_browsersync.yml` under `web_manager.env.FIREBASE_EMULATOR_CONNECT` and made available to the frontend at build time.
|
|
38
38
|
|
|
39
|
+
### PurgeCSS
|
|
40
|
+
|
|
41
|
+
PurgeCSS runs automatically in production builds and can be enabled locally with `UJ_PURGECSS=true`. Consuming projects can add custom safelist patterns via `config/ultimate-jekyll-manager.json` under `sass.purgecss.safelist`:
|
|
42
|
+
|
|
43
|
+
```json5
|
|
44
|
+
{
|
|
45
|
+
sass: {
|
|
46
|
+
purgecss: {
|
|
47
|
+
safelist: {
|
|
48
|
+
standard: ["^my-component-"], // Match full class names
|
|
49
|
+
deep: [], // Match including children
|
|
50
|
+
greedy: [], // Match anywhere in selector
|
|
51
|
+
keyframes: [], // Preserve keyframe animations
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Each entry is a regex string that gets converted to a `RegExp` and merged into the corresponding PurgeCSS safelist category.
|
|
59
|
+
|
|
39
60
|
## Asset Organization
|
|
40
61
|
|
|
41
62
|
### Ultimate Jekyll Manager Files (THIS project)
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
+
distribute: {
|
|
3
|
+
input: [],
|
|
4
|
+
},
|
|
2
5
|
webpack: {
|
|
3
6
|
target: 'default',
|
|
4
7
|
},
|
|
8
|
+
sass: {
|
|
9
|
+
purgecss: {
|
|
10
|
+
safelist: {
|
|
11
|
+
standard: [],
|
|
12
|
+
deep: [],
|
|
13
|
+
greedy: [],
|
|
14
|
+
keyframes: [],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
5
18
|
imagemin: {
|
|
6
19
|
enabled: true,
|
|
7
20
|
},
|
|
8
|
-
distribute: {
|
|
9
|
-
input: [],
|
|
10
|
-
},
|
|
11
21
|
github: {
|
|
12
22
|
workflows: {
|
|
13
23
|
build: {
|
package/dist/gulp/tasks/sass.js
CHANGED
|
@@ -81,6 +81,8 @@ const compiled = {};
|
|
|
81
81
|
const MAIN_BUNDLE_PAGE_PARTIALS = false; // Set to true to merge pages into _page-specific.scss, false to compile separately
|
|
82
82
|
// Enable PurgeCSS via environment variable or in production mode
|
|
83
83
|
const ENABLE_PURGECSS = Manager.isBuildMode() || process.env.UJ_PURGECSS === 'true';
|
|
84
|
+
// Load UJM config for user-defined PurgeCSS safelist
|
|
85
|
+
const ujmConfig = Manager.getUJMConfig();
|
|
84
86
|
|
|
85
87
|
// SASS Compilation Task
|
|
86
88
|
function sass(complete) {
|
|
@@ -272,6 +274,9 @@ function sass(complete) {
|
|
|
272
274
|
|
|
273
275
|
// Social
|
|
274
276
|
/^social-share-/,
|
|
277
|
+
|
|
278
|
+
// User-defined safelist from ultimate-jekyll-manager.json
|
|
279
|
+
...(ujmConfig?.sass?.purgecss?.safelist?.standard || []).map(s => new RegExp(s)),
|
|
275
280
|
],
|
|
276
281
|
deep: [
|
|
277
282
|
// Preserve input state pseudo-selectors (checkbox, radio, etc.)
|
|
@@ -282,8 +287,14 @@ function sass(complete) {
|
|
|
282
287
|
/:hover/,
|
|
283
288
|
/:valid/,
|
|
284
289
|
/:invalid/,
|
|
290
|
+
|
|
291
|
+
// User-defined
|
|
292
|
+
...(ujmConfig?.sass?.purgecss?.safelist?.deep || []).map(s => new RegExp(s)),
|
|
293
|
+
],
|
|
294
|
+
greedy: [
|
|
295
|
+
// User-defined
|
|
296
|
+
...(ujmConfig?.sass?.purgecss?.safelist?.greedy || []).map(s => new RegExp(s)),
|
|
285
297
|
],
|
|
286
|
-
greedy: [],
|
|
287
298
|
// Preserve keyframe animations
|
|
288
299
|
keyframes: [
|
|
289
300
|
/^spinner-/,
|
|
@@ -291,6 +302,9 @@ function sass(complete) {
|
|
|
291
302
|
// /^fade-/,
|
|
292
303
|
// /^slide-/,
|
|
293
304
|
// /^collapse/
|
|
305
|
+
|
|
306
|
+
// User-defined
|
|
307
|
+
...(ujmConfig?.sass?.purgecss?.safelist?.keyframes || []).map(s => new RegExp(s)),
|
|
294
308
|
]
|
|
295
309
|
},
|
|
296
310
|
// Don't remove CSS variables
|