File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -395,15 +395,11 @@ export default class AddGenerator extends Generator {
395395 ( p : boolean ) : void => {
396396 if ( p ) {
397397 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 ( "" )
407403 this . configuration . config . topScope . push (
408404 `const ${ pluginName } = require("${ answerToAction . actionAnswer } ")`
409405 ) ;
You can’t perform that action at this time.
0 commit comments