Skip to content

Commit 78e583d

Browse files
Comment and XML doc tweaks
1 parent 7c07beb commit 78e583d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Microsoft.AspNetCore.SpaServices/Webpack/WebpackDevMiddlewareOptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public class WebpackDevMiddlewareOptions
5252
public IDictionary<string, string> EnvironmentVariables { get; set; }
5353

5454
/// <summary>
55-
/// Pass in the env parameter to webpack.
55+
/// Specifies a value for the "env" parameter to be passed into the Webpack configuration
56+
/// function. The value must be JSON-serializable, and will only be used if the Webpack
57+
/// configuration is exported as a function.
5658
/// </summary>
5759
public object EnvParam { get; set; }
5860
}

src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
244244
: (webpackConfigModuleExports as WebpackConfigExport);
245245

246246
if (webpackConfigExport instanceof Function) {
247-
// If you export a function, we'll call it with an undefined 'env' arg, since we have nothing else
248-
// to pass. This is the same as what the webpack CLI tool does if you specify no '--env.x' values.
249-
// In the future, we could add support for configuring the 'env' param in Startup.cs. But right
250-
// now, it's not clear that people will want to do that (and they can always make up their own
251-
// default env values in their webpack.config.js).
247+
// If you export a function, then Webpack convention is that it takes zero or one param,
248+
// and that param is called `env` and reflects the `--env.*` args you can specify on
249+
// the command line (e.g., `--env.prod`).
250+
// When invoking it via WebpackDevMiddleware, we let you configure the `env` param in
251+
// your Startup.cs.
252252
webpackConfigExport = webpackConfigExport(options.suppliedOptions.EnvParam);
253253
}
254254
const webpackConfigArray = webpackConfigExport instanceof Array ? webpackConfigExport : [webpackConfigExport];

0 commit comments

Comments
 (0)