MCPcopy
hub / github.com/web-infra-dev/rsbuild / updateConfigForTest

Function updateConfigForTest

e2e/helper/jsApi.ts:16–35  ·  view source on GitHub ↗
(originalConfig: RsbuildConfig, cwd: string = process.cwd())

Source from the content-addressed store, hash-verified

14import { getRandomPort, gotoPage, noop, toPosixPath } from './utils.ts';
15
16const updateConfigForTest = async (originalConfig: RsbuildConfig, cwd: string = process.cwd()) => {
17 const { loadConfig, mergeRsbuildConfig } = await import('@rsbuild/core');
18 const { content: loadedConfig } = await loadConfig({
19 cwd,
20 });
21
22 const baseConfig: RsbuildConfig = {
23 server: {
24 // make port random to avoid conflict
25 port: await getRandomPort(),
26 },
27 performance: {
28 buildCache: false,
29 },
30 };
31
32 const mergedConfig = mergeRsbuildConfig(baseConfig, loadedConfig, originalConfig);
33
34 return mergedConfig;
35};
36
37const filterSourceMaps = (distFiles: Record<string, string>) => {
38 return Object.entries(distFiles).reduce(

Callers 2

devFunction · 0.85
buildFunction · 0.85

Calls 3

getRandomPortFunction · 0.90
mergeRsbuildConfigFunction · 0.85
loadConfigFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…