File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -395,15 +395,11 @@ export default class AddGenerator extends Generator {
395
395
( p : boolean ) : void => {
396
396
if ( p ) {
397
397
this . dependencies . push ( answerToAction . actionAnswer ) ;
398
- const normalizePluginName = answerToAction . actionAnswer . replace (
399
- "-webpack-plugin" ,
400
- "Plugin"
401
- ) ;
402
- const pluginName = replaceAt (
403
- normalizePluginName ,
404
- 0 ,
405
- normalizePluginName . charAt ( 0 ) . toUpperCase ( )
406
- ) ;
398
+ let myPluginNameArray = answerToAction . actionAnswer . split ( "-" )
399
+ for ( let i = 0 ; i < myPluginNameArray . length ; i ++ ) {
400
+ myPluginNameArray [ i ] = replaceAt ( myPluginNameArray [ i ] , 0 , myPluginNameArray [ i ] . charAt ( 0 ) . toUpperCase ( ) ) ;
401
+ }
402
+ const pluginName = myPluginNameArray . join ( "" )
407
403
this . configuration . config . topScope . push (
408
404
`const ${ pluginName } = require("${ answerToAction . actionAnswer } ")`
409
405
) ;
You can’t perform that action at this time.
0 commit comments