File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,12 @@ module.exports = class AddGenerator extends Generator {
129
129
false : { }
130
130
} ;
131
131
}
132
+ if ( action === "mode" ) {
133
+ defOrPropDescription = {
134
+ development : { } ,
135
+ production : { }
136
+ } ;
137
+ }
132
138
// If we've got a schema prop or devServer Schema Prop
133
139
if ( defOrPropDescription || webpackDevserverSchemaProp ) {
134
140
// Check for properties in definitions[action] or properties[action]
@@ -255,7 +261,7 @@ module.exports = class AddGenerator extends Generator {
255
261
isDeepProp [ 1 ] = answerToAction . actionAnswer ;
256
262
if (
257
263
isDeepProp [ 1 ] !== "other" &&
258
- ( action === "devtool" || action === "watch" )
264
+ ( action === "devtool" || action === "watch" || action === "mode" )
259
265
) {
260
266
this . configuration . config . item = action ;
261
267
this . configuration . config . webpackOptions [ action ] = `'${
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const moduleTransform = require("./module/module");
28
28
const pluginsTransform = require ( "./plugins/plugins" ) ;
29
29
const topScopeTransform = require ( "./top-scope/top-scope" ) ;
30
30
const devServerTransform = require ( "./devServer/devServer" ) ;
31
+ const modeTransform = require ( "./mode/mode" ) ;
31
32
32
33
/*
33
34
* @function runTransform
@@ -60,7 +61,8 @@ const transformsObject = {
60
61
pluginsTransform,
61
62
topScopeTransform,
62
63
mergeTransform,
63
- devServerTransform
64
+ devServerTransform,
65
+ modeTransform
64
66
} ;
65
67
66
68
module . exports = function runTransform ( webpackProperties , action ) {
Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ module.exports = new Set([
13
13
"target" ,
14
14
"watch" ,
15
15
"watchOptions" ,
16
- "stats"
16
+ "stats" ,
17
+ "mode"
17
18
] ) ;
You can’t perform that action at this time.
0 commit comments