Skip to content

Commit

Permalink
build: rename carbon and buysell chunks (vuejs#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
posva authored and YunYouJun committed Aug 30, 2021
1 parent bde63dc commit 2b4faee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/client/theme-default/components/BuySellAds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 5 additions & 1 deletion src/node/build/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
})
}
Expand Down Expand Up @@ -95,3 +97,5 @@ export async function bundle(

return [clientResult, serverResult, pageToHashMap]
}

const adComponentRE = /(?:Carbon|BuySell)Ads/

0 comments on commit 2b4faee

Please sign in to comment.