Skip to content

Commit

Permalink
add modifyDefaultConfig api for plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yutingzhao1991 committed Jun 28, 2018
1 parent 0ad6e0b commit 19720b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/umi-build-dev/src/UserConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ class UserConfig {
throw new Error(msg);
}

const defaultConfig = this.service.applyPlugins('modifyDefaultConfig', {
initialValue: {},
});

config = normalizeConfig({
...defaultConfig,
...requireFile(file, { onError }),
...(env ? requireFile(file.replace(/\.js$/, `.${env}.js`)) : {}),
...(isDev ? requireFile(file.replace(/\.js$/, '.local.js')) : {}),
Expand Down

0 comments on commit 19720b6

Please sign in to comment.