build: emit ads chunks with hash-only filenames

A fixed ui-custom name still gives adblock filter lists a stable
string to match on. Emit the Carbon/BuySellAds chunks with just the
content hash instead. Changes the emitted filenames for those chunks
and, transitively, the hashes of chunks that import them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pull/5342/head
Divyansh Singh 1 month ago
parent b8ec0b563a
commit 343aa13b68

@ -120,7 +120,7 @@ export async function bundle(
chunkFileNames(chunk) {
// avoid ads chunk being intercepted by adblock
return /(?:Carbon|BuySell)Ads/.test(chunk.name)
? `${config.assetsDir}/chunks/ui-custom.[hash].js`
? `${config.assetsDir}/chunks/[hash].js`
: `${config.assetsDir}/chunks/[name].[hash].js`
},
codeSplitting: {

Loading…
Cancel
Save