WebpackDevMiddleware should run in a separate Node instance that doesn't restart when files change (otherwise there's no point in running it at all)

This commit is contained in:
SteveSandersonMS
2016-02-09 17:26:04 -08:00
parent 6c903f33ae
commit 2e9a43d1dc
6 changed files with 76 additions and 24 deletions

View File

@@ -17,11 +17,19 @@ namespace Microsoft.AspNet.NodeServices {
private int _portNumber;
public HttpNodeInstance(string projectPath, int port = 0)
: base(EmbeddedResourceReader.Read(typeof(HttpNodeInstance), "/Content/Node/entrypoint-http.js"), projectPath, port.ToString())
public HttpNodeInstance(string projectPath, int port = 0, string[] watchFileExtensions = null)
: base(EmbeddedResourceReader.Read(typeof(HttpNodeInstance), "/Content/Node/entrypoint-http.js"), projectPath, MakeCommandLineOptions(port, watchFileExtensions))
{
}
private static string MakeCommandLineOptions(int port, string[] watchFileExtensions) {
var result = "--port " + port.ToString();
if (watchFileExtensions != null && watchFileExtensions.Length > 0) {
result += " --watch " + string.Join(",", watchFileExtensions);
}
return result;
}
public override async Task<T> Invoke<T>(NodeInvocationInfo invocationInfo) {
await this.EnsureReady();