File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,6 +129,12 @@ module.exports = class AddGenerator extends Generator {
129129 false : { }
130130 } ;
131131 }
132+ if ( action === "mode" ) {
133+ defOrPropDescription = {
134+ development : { } ,
135+ production : { }
136+ } ;
137+ }
132138 // If we've got a schema prop or devServer Schema Prop
133139 if ( defOrPropDescription || webpackDevserverSchemaProp ) {
134140 // Check for properties in definitions[action] or properties[action]
@@ -255,7 +261,7 @@ module.exports = class AddGenerator extends Generator {
255261 isDeepProp [ 1 ] = answerToAction . actionAnswer ;
256262 if (
257263 isDeepProp [ 1 ] !== "other" &&
258- ( action === "devtool" || action === "watch" )
264+ ( action === "devtool" || action === "watch" || action === "mode" )
259265 ) {
260266 this . configuration . config . item = action ;
261267 this . configuration . config . webpackOptions [ action ] = `'${
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const moduleTransform = require("./module/module");
2828const pluginsTransform = require ( "./plugins/plugins" ) ;
2929const topScopeTransform = require ( "./top-scope/top-scope" ) ;
3030const devServerTransform = require ( "./devServer/devServer" ) ;
31+ const modeTransform = require ( "./mode/mode" ) ;
3132
3233/*
3334* @function runTransform
@@ -60,7 +61,8 @@ const transformsObject = {
6061 pluginsTransform,
6162 topScopeTransform,
6263 mergeTransform,
63- devServerTransform
64+ devServerTransform,
65+ modeTransform
6466} ;
6567
6668module . exports = function runTransform ( webpackProperties , action ) {
Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ module.exports = new Set([
1313 "target" ,
1414 "watch" ,
1515 "watchOptions" ,
16- "stats"
16+ "stats" ,
17+ "mode"
1718] ) ;
You can’t perform that action at this time.
0 commit comments