import togglePlugin from "./togglePlugin" ; import isDefaultPlugin from "./isDefaultPlugin" ; param { Config } config param { string } plugin return { Config } function removePlugin ( config , pluginName ) { let deps = config . getPluginDependencies ( ) ; if ( isDefaultPlugin ( pluginName ) ) { return togglePlugin ( config , pluginName , false ) ; } deps = deps . filterNot ( ( dep ) => { return dep . getName ( ) === pluginName ; } ) ; return config . setPluginDependencies ( deps ) ; } export default removePlugin ;