Skip to content

Commit

Permalink
feat(config): Make getConfig options override loaded options
Browse files Browse the repository at this point in the history
  • Loading branch information
jcowman2 committed Dec 12, 2018
1 parent 9cd1436 commit 3d589f6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/get-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,16 @@ export const getConfig = async (
opts: RecursivePartial<BundlerOptions> = {}
): Promise<LoadedConfiguration> => {
const userOpts = await loadUserConfig(opts.configLocation);
return fillInOpts(userOpts);
const filledOpts = fillInOpts(userOpts);

if (opts.bundler !== undefined) {
if (opts.bundler.input !== undefined) {
Object.assign(filledOpts.bundleConfig.input, opts.bundler.input);
}
if (opts.bundler.output !== undefined) {
Object.assign(filledOpts.bundleConfig.output, opts.bundler.output);
}
}

return filledOpts;
};

0 comments on commit 3d589f6

Please sign in to comment.