refactor: implement socket.io method overrides and enhance logging for productCache in Content component to improve category data handling
This commit is contained in:
@@ -143,14 +143,7 @@ class InlineCssPlugin {
|
||||
// Remove existing CSS link tags from HTML
|
||||
data.html = data.html.replace(/<link[^>]*href="[^"]*\.css"[^>]*>/g, '');
|
||||
|
||||
// Find JavaScript files to preload
|
||||
const jsPreloads = [];
|
||||
Object.keys(compilation.assets).forEach(assetName => {
|
||||
if (assetName.endsWith('.js') && !assetName.includes('chunk')) {
|
||||
// Only preload main bundle and vendor files, not chunks
|
||||
jsPreloads.push(`<link rel="preload" href="/${assetName}" as="script" crossorigin>\n`);
|
||||
}
|
||||
});
|
||||
// JavaScript file preloading removed
|
||||
|
||||
// Extract font URLs from CSS for preloading - DISABLED
|
||||
// const fontUrls = [];
|
||||
@@ -202,16 +195,13 @@ class InlineCssPlugin {
|
||||
// Add inlined CSS to head
|
||||
const styleTag = `<style type="text/css">${inlinedCss.trim()}</style>`;
|
||||
|
||||
// Place only JS preloads in the head, no font or image preloads
|
||||
data.html = data.html.replace('</head>', `${styleTag}\n${jsPreloads.join('')}</head>`);
|
||||
// Add only the style tag to head (no JS preloads)
|
||||
data.html = data.html.replace('</head>', `${styleTag}\n</head>`);
|
||||
|
||||
console.log(`✅ Inlined CSS assets: ${cssAssets.join(', ')} (${Math.round(inlinedCss.length / 1024)}KB)`);
|
||||
// if (fontUrls.length > 0) {
|
||||
// console.log(`✅ Added font preloads: ${fontUrls.length} fonts`);
|
||||
// }
|
||||
if (jsPreloads.length > 0) {
|
||||
console.log(`✅ Added JS preloads: ${jsPreloads.length} files`);
|
||||
}
|
||||
|
||||
// Log whether images were preloaded
|
||||
console.log(`Page: ${outputPath} - Is homepage: ${isHomePage}`);
|
||||
|
||||
Reference in New Issue
Block a user