File tree Expand file tree Collapse file tree
packages/openapi-ts/src/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,13 +149,16 @@ export function getPlugins({
149149
150150 const seenPlugins = new Set < string > ( ) ;
151151
152+ const warnDuplicatePlugin = ( name : string ) =>
153+ console . warn (
154+ `⚙️ ${ colors . yellow ( 'Warning:' ) } Duplicate plugin ${ colors . cyan ( `"${ name } "` ) } detected. Only the last occurrence will take effect.` ,
155+ ) ;
156+
152157 const userPlugins = definedPlugins
153158 . map ( ( plugin ) => {
154159 if ( typeof plugin === 'string' ) {
155160 if ( seenPlugins . has ( plugin ) ) {
156- console . warn (
157- `⚙️ ${ colors . yellow ( 'Warning:' ) } Duplicate plugin ${ colors . cyan ( `"${ plugin } "` ) } detected. The last configuration will be used.` ,
158- ) ;
161+ warnDuplicatePlugin ( plugin ) ;
159162 }
160163 seenPlugins . add ( plugin ) ;
161164 return plugin ;
@@ -165,9 +168,7 @@ export function getPlugins({
165168
166169 if ( pluginName ) {
167170 if ( seenPlugins . has ( pluginName ) ) {
168- console . warn (
169- `⚙️ ${ colors . yellow ( 'Warning:' ) } Duplicate plugin ${ colors . cyan ( `"${ pluginName } "` ) } detected. The last configuration will be used.` ,
170- ) ;
171+ warnDuplicatePlugin ( pluginName ) ;
171172 }
172173 seenPlugins . add ( pluginName ) ;
173174
You can’t perform that action at this time.
0 commit comments