File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/Microsoft.AspNetCore.SpaServices/Webpack Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ public static void UseWebpackDevMiddleware(
4242 // as fast as some theoretical future alternative.
4343 var nodeServicesOptions = new NodeServicesOptions ( appBuilder . ApplicationServices ) ;
4444 nodeServicesOptions . WatchFileExtensions = new string [ ] { } ; // Don't watch anything
45+ if ( ! string . IsNullOrEmpty ( options . ProjectPath ) )
46+ {
47+ nodeServicesOptions . ProjectPath = options . ProjectPath ;
48+ }
49+
4550 var nodeServices = NodeServicesFactory . CreateNodeServices ( nodeServicesOptions ) ;
4651
4752 // Get a filename matching the middleware Node script
@@ -50,11 +55,9 @@ public static void UseWebpackDevMiddleware(
5055 var nodeScript = new StringAsTempFile ( script ) ; // Will be cleaned up on process exit
5156
5257 // Tell Node to start the server hosting webpack-dev-middleware
53- var hostEnv = ( IHostingEnvironment ) appBuilder . ApplicationServices . GetService ( typeof ( IHostingEnvironment ) ) ;
54- var projectPath = options . ProjectPath ?? hostEnv . ContentRootPath ;
5558 var devServerOptions = new
5659 {
57- webpackConfigPath = Path . Combine ( projectPath , options . ConfigFile ?? DefaultConfigFile ) ,
60+ webpackConfigPath = Path . Combine ( nodeServicesOptions . ProjectPath , options . ConfigFile ?? DefaultConfigFile ) ,
5861 suppliedOptions = options
5962 } ;
6063 var devServerInfo =
You can’t perform that action at this time.
0 commit comments