diff --git a/packages/namer/namer.js b/packages/namer/namer.js index 04ecd19dd..766c4ef04 100644 --- a/packages/namer/namer.js +++ b/packages/namer/namer.js @@ -16,18 +16,24 @@ function value(source, count) { return out; } -module.exports = () => { +module.exports = ({ verbose = false } = false) => { const meta = new Map(); const cache = new Map(); return function namer(file, selector) { const key = `${file}${selector}`; + if(cache.has(key)) { return cache.get(key); } if(!meta.has(file)) { + if(verbose) { + // eslint-disable-next-line no-console -- debug logging + console.log(`NAMER: Seen ${file} for the first time`); + } + meta.set(file, { id : meta.size, selectors : new Map(), @@ -43,6 +49,11 @@ module.exports = () => { cache.set(key, output); + if(verbose) { + // eslint-disable-next-line no-console -- debug logging + console.log(`NAMER: ${key} => ${output}`); + } + return output; }; }; diff --git a/packages/www/build/mcss-setup.js b/packages/www/build/mcss-setup.js index e73fcf842..c1bb2679f 100644 --- a/packages/www/build/mcss-setup.js +++ b/packages/www/build/mcss-setup.js @@ -20,7 +20,7 @@ const { preprocess, processor } = preprocessor({ // TODO: disabled because weird stuff is happening on Netlify, maybe around file paths? // Crank down names in prod to be itty-bitty - // namer : isProd ? namer() : null, + namer : isProd ? namer({ verbose : true }) : null, // Bring sveltekit aliases into m-css resolvers : [