Skip to content

Commit 02c5801

Browse files
committed
fix(ui): stop forcing the webpack vendor output path
Currently, starting the local development web server with `npm start` reaches this error: ``` <e> [webpack-dev-middleware] Error: Conflict: Multiple chunks emit assets to the same filename static/vendors.js (chunks vendorsJs-node_modules_mini-css-extract-plugin_dist_hmr_hotModuleReplacement_js-node_modules_-335b30 and vendorsJs-node_modules_hotwired_turbo_dist_turbo_es2017-esm_js-node_modules_github_clipboard--ac61ee) <e> at /home/timzh/osv.dev/gcp/website/frontend3/node_modules/webpack/lib/Compilation.js:5154:12 <e> at /home/timzh/osv.dev/gcp/website/frontend3/node_modules/webpack/lib/Cache.js:98:34 <e> at Array.<anonymous> (/home/timzh/osv.dev/gcp/website/frontend3/node_modules/webpack/lib/cache/MemoryCachePlugin.js:44:13) <e> at /home/timzh/osv.dev/gcp/website/frontend3/node_modules/webpack/lib/Cache.js:98:19 <e> at Hook.eval [as callAsync] (eval at create (/home/timzh/osv.dev/gcp/website/frontend3/node_modules/tapable/lib/HookCodeFactory.js:31:10), <anonymous>:19:1) <e> at Cache.get (/home/timzh/osv.dev/gcp/website/frontend3/node_modules/webpack/lib/Cache.js:82:18) <e> at ItemCacheFacade.get (/home/timzh/osv.dev/gcp/website/frontend3/node_modules/webpack/lib/CacheFacade.js:115:15) <e> at /home/timzh/osv.dev/gcp/website/frontend3/node_modules/webpack/lib/Compilation.js:5096:22 <e> at arrayEach (/home/timzh/osv.dev/gcp/website/frontend3/node_modules/neo-async/async.js:2405:9) <e> at Object.each (/home/timzh/osv.dev/gcp/website/frontend3/node_modules/neo-async/async.js:2846:9) ``` The issue as I understand it is that webpack tries to write to the same vendor.js file twice independently. I think ed504ac introduced the issue when it added a second entry point: ed504ac#diff-9f8239968359c3509ed79cdc472a92a08b4aea2446077d8cd8453fcb59ffd711R11. Using `name` groups both vendor chunks to the same logical ID, rather than the same conflicting file path. This doesn't change any build artifacts' paths, so shouldn't affect the frontend's deployment, I think.
1 parent 6d0ad9b commit 02c5801

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

gcp/website/frontend3/webpack.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
vendorsJs: {
2525
test: /node_modules/,
2626
chunks: 'initial',
27-
filename: 'static/vendors.js',
27+
name: 'vendors',
2828
priority: 1,
2929
maxInitialRequests: 2,
3030
minChunks: 1,

gcp/website/frontend3/webpack.prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
vendorsJs: {
2525
test: /node_modules/,
2626
chunks: 'initial',
27-
filename: 'static/vendors.[contenthash].js',
27+
name: 'vendors',
2828
priority: 1,
2929
maxInitialRequests: 2,
3030
minChunks: 1,

0 commit comments

Comments
 (0)