Skip to content

Commit

Permalink
remove mergeLoaders option (always merge loaders)
Browse files Browse the repository at this point in the history
fixes #299
  • Loading branch information
d-fischer committed Mar 18, 2023
1 parent a003583 commit 71051b3
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function getExplorerOptions(

const mergedOptions = { ...options, ...overrideOptions };

return normalizeOptions(moduleName, mergedOptions, false);
return normalizeOptions(moduleName, mergedOptions);
}

function cosmiconfig(
Expand Down Expand Up @@ -184,17 +184,14 @@ function cosmiconfigSync(
function normalizeOptions(
moduleName: string,
options: OptionsSync,
mergeLoaders?: boolean,
): ExplorerOptionsSync;
function normalizeOptions(
moduleName: string,
options: Options,
mergeLoaders?: boolean,
): ExplorerOptions;
function normalizeOptions(
moduleName: string,
options: Options | OptionsSync,
mergeLoaders = true,
): ExplorerOptions | ExplorerOptionsSync {
const defaults: ExplorerOptions | ExplorerOptionsSync = {
packageProp: moduleName,
Expand Down Expand Up @@ -228,15 +225,7 @@ function normalizeOptions(
};

if (options.loaders) {
// to be used for the upcoming loaders-in-config
/* istanbul ignore next -- @preserve */
if (mergeLoaders) {
Object.assign(loaders, options.loaders);
} else {
loaders = {
...options.loaders,
};
}
Object.assign(loaders, options.loaders);
}

return {
Expand Down

0 comments on commit 71051b3

Please sign in to comment.