@@ -18,11 +18,11 @@ const entryQuestions = require("./utils/entry");
18
18
* Replaces the string with a substring at the given index
19
19
* https://gist.github.com/efenacigiray/9367920
20
20
*
21
- * @param {String } string - string to be modified
22
- * @param {Number } index - index to replace from
23
- * @param {String } replace - string to replace starting from index
21
+ * @param {String } string - string to be modified
22
+ * @param {Number } index - index to replace from
23
+ * @param {String } replace - string to replace starting from index
24
24
*
25
- * @returns {String } string - The newly mutated string
25
+ * @returns {String } string - The newly mutated string
26
26
*
27
27
*/
28
28
function replaceAt ( string , index , replace ) {
@@ -33,10 +33,10 @@ function replaceAt(string, index, replace) {
33
33
*
34
34
* Checks if the given array has a given property
35
35
*
36
- * @param {Array } arr - array to check
37
- * @param {String } prop - property to check existence of
36
+ * @param {Array } arr - array to check
37
+ * @param {String } prop - property to check existence of
38
38
*
39
- * @returns {Boolean } hasProp - Boolean indicating if the property
39
+ * @returns {Boolean } hasProp - Boolean indicating if the property
40
40
* is present
41
41
*/
42
42
const traverseAndGetProperties = ( arr , prop ) => {
@@ -52,9 +52,9 @@ const traverseAndGetProperties = (arr, prop) => {
52
52
/**
53
53
*
54
54
* Generator for adding properties
55
- * @class AddGenerator
56
- * @extends Generator
57
- * @returns {Void } After execution, transforms are triggered
55
+ * @class AddGenerator
56
+ * @extends Generator
57
+ * @returns {Void } After execution, transforms are triggered
58
58
*
59
59
*/
60
60
@@ -65,7 +65,9 @@ module.exports = class AddGenerator extends Generator {
65
65
this . configuration = {
66
66
config : {
67
67
webpackOptions : { } ,
68
- topScope : [ "const webpack = require('webpack')" ]
68
+ topScope : [
69
+ "const webpack = require('webpack')"
70
+ ]
69
71
}
70
72
} ;
71
73
}
@@ -76,6 +78,7 @@ module.exports = class AddGenerator extends Generator {
76
78
let self = this ;
77
79
let manualOrListInput = action =>
78
80
Input ( "actionAnswer" , `what do you want to add to ${ action } ?` ) ;
81
+
79
82
// first index indicates if it has a deep prop, 2nd indicates what kind of
80
83
let isDeepProp = [ false , false ] ;
81
84
@@ -104,7 +107,7 @@ module.exports = class AddGenerator extends Generator {
104
107
return entryQuestions ( self , entryTypeAnswer ) ;
105
108
} )
106
109
. then ( entryOptions => {
107
- this . configuration . config . webpackOptions [ action ] = entryOptions ;
110
+ this . configuration . config . webpackOptions . entry = entryOptions ;
108
111
this . configuration . config . item = action ;
109
112
} ) ;
110
113
}
0 commit comments