fix(build): explicitly specify asset and entry file names (#1607)

pull/1615/head
Divyansh Singh 2 years ago committed by GitHub
parent cc91d555b5
commit 8601e1596b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,17 +71,19 @@ export async function bundle(
output: { output: {
sanitizeFileName, sanitizeFileName,
...rollupOptions?.output, ...rollupOptions?.output,
assetFileNames: 'assets/[name].[hash].[ext]',
...(ssr ...(ssr
? { ? {
entryFileNames: `[name].js`, entryFileNames: '[name].js',
chunkFileNames: `[name].[hash].js` chunkFileNames: '[name].[hash].js'
} }
: { : {
entryFileNames: 'assets/[name].[hash].js',
chunkFileNames(chunk) { chunkFileNames(chunk) {
// avoid ads chunk being intercepted by adblock // avoid ads chunk being intercepted by adblock
return /(?:Carbon|BuySell)Ads/.test(chunk.name) return /(?:Carbon|BuySell)Ads/.test(chunk.name)
? `assets/chunks/ui-custom.[hash].js` ? 'assets/chunks/ui-custom.[hash].js'
: `assets/chunks/[name].[hash].js` : 'assets/chunks/[name].[hash].js'
}, },
manualChunks(id, ctx) { manualChunks(id, ctx) {
// move known framework code into a stable chunk so that // move known framework code into a stable chunk so that

Loading…
Cancel
Save