Skip to content

Commit

Permalink
Move file
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 30, 2022
1 parent 349feb5 commit cb9a505
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 1 addition & 8 deletions src/config/plugin/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { createRequire } from 'module'
import { PluginError, UserError } from '../../error/main.js'
import { wrapError } from '../../error/wrap.js'
import { PLUGINS_IMPORT_BASE } from '../normalize/cwd.js'
import { normalizeConfig } from '../normalize/main.js'

import { getPluginConfig } from './config.js'
import { getModuleId } from './id.js'
import { normalizePlugin } from './normalize.js'

// Import plugin's code
export const loadPlugins = async function (pluginType, config, context) {
Expand Down Expand Up @@ -93,10 +93,3 @@ This Node module was not found, please ensure it is installed.\n\n`,
)
}
}

// Validate a plugin has the correct shape and normalize it
const normalizePlugin = async function (plugin, mainDefinitions) {
return await normalizeConfig(plugin, mainDefinitions, {
ErrorType: PluginError,
})
}
9 changes: 9 additions & 0 deletions src/config/plugin/normalize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { PluginError } from '../../error/main.js'
import { normalizeConfig } from '../normalize/main.js'

// Validate a plugin has the correct shape and normalize it
export const normalizePlugin = async function (plugin, mainDefinitions) {
return await normalizeConfig(plugin, mainDefinitions, {
ErrorType: PluginError,
})
}

0 comments on commit cb9a505

Please sign in to comment.