Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/node/build/bundle.ts
Expand Up @@ -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
Expand Down