From 8601e1596b45e6684b71964d002133fb32d51b9f Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 15 Nov 2022 05:32:43 +0530 Subject: [PATCH] fix(build): explicitly specify asset and entry file names (#1607) --- src/node/build/bundle.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index 7da869cd386c..d51b0f231113 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -71,17 +71,19 @@ export async function bundle( output: { sanitizeFileName, ...rollupOptions?.output, + assetFileNames: 'assets/[name].[hash].[ext]', ...(ssr ? { - entryFileNames: `[name].js`, - chunkFileNames: `[name].[hash].js` + entryFileNames: '[name].js', + chunkFileNames: '[name].[hash].js' } : { + entryFileNames: 'assets/[name].[hash].js', chunkFileNames(chunk) { // avoid ads chunk being intercepted by adblock return /(?:Carbon|BuySell)Ads/.test(chunk.name) - ? `assets/chunks/ui-custom.[hash].js` - : `assets/chunks/[name].[hash].js` + ? 'assets/chunks/ui-custom.[hash].js' + : 'assets/chunks/[name].[hash].js' }, manualChunks(id, ctx) { // move known framework code into a stable chunk so that