mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
feat(core): allow configureWebpack to return undefined (#6784)
* plugin: not acquire configureWebpack to return * type fix * add test * remove type Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
1777fc4d76
commit
6b3d94a155
|
|
@ -74,7 +74,7 @@ describe('extending generated webpack config', () => {
|
|||
filename: 'new.bundle.js',
|
||||
};
|
||||
}
|
||||
return {};
|
||||
// Implicitly returning undefined to test null-safety
|
||||
};
|
||||
|
||||
config = applyConfigureWebpack(configureWebpack, config, false, undefined, {
|
||||
|
|
|
|||
|
|
@ -184,12 +184,8 @@ export function applyConfigureWebpack(
|
|||
getJSLoader: getCustomizableJSLoader(jsLoader),
|
||||
};
|
||||
if (typeof configureWebpack === 'function') {
|
||||
const {mergeStrategy, ...res} = configureWebpack(
|
||||
config,
|
||||
isServer,
|
||||
utils,
|
||||
content,
|
||||
);
|
||||
const {mergeStrategy, ...res} =
|
||||
configureWebpack(config, isServer, utils, content) ?? {};
|
||||
if (res && typeof res === 'object') {
|
||||
const customizeRules = mergeStrategy ?? {};
|
||||
return mergeWithCustomize({
|
||||
|
|
|
|||
Loading…
Reference in New Issue