Skip to content

Commit 3f5269c

Browse files
committed
Adds webview-specific overrides to build config
1 parent a6b058d commit 3f5269c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

webpack.config.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ function getWebviewsConfigs(mode, env) {
318318
timeline: { entry: './plus/timeline/timeline.ts', plus: true },
319319
patchDetails: { entry: './plus/patchDetails/patchDetails.ts', plus: true },
320320
},
321+
{},
321322
mode,
322323
env,
323324
),
@@ -413,12 +414,13 @@ function getWebviewsCommonConfig(mode, env) {
413414
}
414415

415416
/**
416-
* @param {{ [key:string]: {entry: string; plus?: boolean }}} webviews
417+
* @param {{ [key:string]: {entry: string; plus?: boolean; alias?: { [key:string]: string } }}} webviews
418+
* @param {{ alias?: { [key:string]: string }}} overrides
417419
* @param { 'production' | 'development' | 'none' } mode
418420
* @param {{ analyzeBundle?: boolean; analyzeDeps?: boolean; esbuild?: boolean; skipLint?: boolean }} env
419421
* @returns { WebpackConfig }
420422
*/
421-
function getWebviewConfig(webviews, mode, env) {
423+
function getWebviewConfig(webviews, overrides, mode, env) {
422424
const basePath = path.join(__dirname, 'src', 'webviews', 'apps');
423425
const tsConfigPath = path.join(basePath, 'tsconfig.json');
424426

@@ -614,6 +616,7 @@ function getWebviewConfig(webviews, mode, env) {
614616
'@env': path.resolve(__dirname, 'src', 'env', 'browser'),
615617
react: path.resolve(__dirname, 'node_modules', 'react'),
616618
'react-dom': path.resolve(__dirname, 'node_modules', 'react-dom'),
619+
...overrides.alias,
617620
},
618621
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
619622
modules: [basePath, 'node_modules'],

0 commit comments

Comments
 (0)