@eleventy-plugin-themer/build-vite 0.1.0 → 0.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/package.json
CHANGED
|
@@ -43,7 +43,15 @@ export const KNOWN_OPTIMIZATIONS = new Set(Object.keys(PLUGIN_REGISTRY));
|
|
|
43
43
|
* @param {string} [dirs.temp] - Temp directory (optional, passed to plugins via options)
|
|
44
44
|
*/
|
|
45
45
|
export async function runOptimizations(optimizations, dirs) {
|
|
46
|
-
|
|
46
|
+
// validateLinks must run last so it checks the final output — after transforms
|
|
47
|
+
// (purge/critical/minify) and after preserveNonHtml restores files like
|
|
48
|
+
// feed.xml / sitemap.xml. Stable-sort keeps every other optimization in the
|
|
49
|
+
// order the consumer declared them.
|
|
50
|
+
const entries = Object.entries(optimizations).sort(
|
|
51
|
+
([a], [b]) => (a === 'validateLinks' ? 1 : 0) - (b === 'validateLinks' ? 1 : 0),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
for (const [name, config] of entries) {
|
|
47
55
|
// Skip if optimization is disabled
|
|
48
56
|
if (!config) continue;
|
|
49
57
|
|