Skip to content

Commit

Permalink
Merge pull request #360 from jdz321/master
Browse files Browse the repository at this point in the history
feat(af-webpack): add preprocessor for config
  • Loading branch information
sorrycc authored Apr 23, 2018
2 parents 2796ce5 + a4bd523 commit e68fcb3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/af-webpack/src/getUserConfig/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default function getUserConfig(opts = {}) {
cwd = process.cwd(),
configFile = '.webpackrc',
disabledConfigs = [],
preprocessor,
} = opts;

// TODO: 支持数组的形式?
Expand All @@ -104,6 +105,9 @@ export default function getUserConfig(opts = {}) {
config = config.default;
}
}
if (typeof preprocessor === 'function') {
config = preprocessor(config);
}

// Context for validate function
const context = {
Expand Down

0 comments on commit e68fcb3

Please sign in to comment.