Skip to content

Commit

Permalink
chore(add-generator): changed the naming of the plugin in config file
Browse files Browse the repository at this point in the history
Changed the naming of the plugin to better and standard and bug free
name in add-generator in plugin question
  • Loading branch information
anikethsaha committed May 24, 2019
1 parent 11554d6 commit 7fbc3a4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/generators/add-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,11 @@ export default class AddGenerator extends Generator {
(p: boolean): void => {
if (p) {
this.dependencies.push(answerToAction.actionAnswer);
const normalizePluginName = answerToAction.actionAnswer.replace(
"-webpack-plugin",
"Plugin"
);
const pluginName = replaceAt(
normalizePluginName,
0,
normalizePluginName.charAt(0).toUpperCase()
);
let myPluginNameArray = answerToAction.actionAnswer.split("-")
for (let i = 0; i < myPluginNameArray.length; i++) {
myPluginNameArray[i] = replaceAt(myPluginNameArray[i], 0, myPluginNameArray[i].charAt(0).toUpperCase());
}
const pluginName = myPluginNameArray.join("")
this.configuration.config.topScope.push(
`const ${pluginName} = require("${answerToAction.actionAnswer}")`
);
Expand Down

0 comments on commit 7fbc3a4

Please sign in to comment.