Skip to content

Commit

Permalink
feat: 载入配置文件的plugin和preset
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Mar 1, 2021
1 parent 52561d4 commit 0798694
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/manager/PluginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ export class PluginManager {

resolvePluginAndPreset() {
const finalPlugins = []
const configPlugins =
this.service.ConfigManager.projectConfig?.plugins || []
const configPresets =
this.service.ConfigManager.projectConfig?.presets || []
// 1. resolve preset to plugin head
this.presets.forEach((preset) => {
;[...this.presets, ...configPresets].forEach((preset) => {
const { plugins = [] } = preset
finalPlugins.push(...plugins)
})
finalPlugins.push(...this.plugins)
finalPlugins.push(...configPlugins)

// 2. skip/deduplication/order/register config
const prePlugins: IPlugin[] = []
Expand Down

0 comments on commit 0798694

Please sign in to comment.