build: rename carbon and buysell chunks (#370)

pull/350/head
Eduardo San Martin Morote 3 years ago committed by GitHub
parent 7b3a9e59b4
commit 858c0e77a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,6 +45,10 @@ onMounted(() => {
function load() {
if (typeof _bsa !== 'undefined' && _bsa) {
const parent = document.querySelector('.bsa-cpc')!
// cleanup any existing ad to avoid them stacking
parent.innerHTML = ''
_bsa.init('default', code, `placement:${placement}`, {
target: '.bsa-cpc',
align: 'horizontal',

@ -64,7 +64,9 @@ export async function bundle(
if (!chunk.isEntry && /runtime/.test(chunk.name)) {
return `assets/framework.[hash].js`
}
return `assets/[name].[hash].js`
return adComponentRE.test(chunk.name)
? `assets/ui-custom.[hash].js`
: `assets/[name].[hash].js`
}
})
}
@ -95,3 +97,5 @@ export async function bundle(
return [clientResult, serverResult, pageToHashMap]
}
const adComponentRE = /(?:Carbon|BuySell)Ads/

Loading…
Cancel
Save