Skip to content

Commit

Permalink
refactor: rename ad components at build
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Aug 19, 2021
1 parent 7b3a9e5 commit c3ce55d
Showing 1 changed file with 5 additions and 1 deletion.
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 c3ce55d

Please sign in to comment.