start-server-webpack-plugin
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -48,2 +48,15 @@ 'use strict'; | ||
}, { | ||
key: '_getInspectPort', | ||
value: function _getInspectPort(execArgv) { | ||
var inspectArg = execArgv.find(function (arg) { | ||
return arg.includes('--inspect'); | ||
}); | ||
if (!inspectArg || !inspectArg.includes('=')) { | ||
return; | ||
} | ||
var hostPort = inspectArg.split('=')[1]; | ||
var port = hostPort.includes(':') ? hostPort.split(':')[1] : hostPort; | ||
return parseInt(port); | ||
} | ||
}, { | ||
key: 'afterEmit', | ||
@@ -85,5 +98,15 @@ value: function afterEmit(compilation, callback) { | ||
var execArgv = this._getArgs(); | ||
var inspectPort = this._getInspectPort(execArgv); | ||
_cluster2.default.setupMaster({ exec: existsAt, execArgv: execArgv }); | ||
var clusterOptions = { | ||
exec: existsAt, | ||
execArgv: execArgv | ||
}; | ||
if (inspectPort) { | ||
clusterOptions.inspectPort = inspectPort; | ||
} | ||
_cluster2.default.setupMaster(clusterOptions); | ||
_cluster2.default.on("online", function (worker) { | ||
@@ -90,0 +113,0 @@ _this.worker = worker; |
{ | ||
"name": "start-server-webpack-plugin", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Automatically start your server once Webpack's build completes.", | ||
@@ -5,0 +5,0 @@ "main": "dist/StartServerPlugin.js", |
@@ -6,3 +6,3 @@ # start-server-webpack-plugin | ||
[![travis build](https://img.shields.io/travis/ericclemmons/start-server-webpack-plugin.svg)](https://travis-ci.org/ericclemmons/start-server-webpack-plugin) | ||
[![version](https://img.shields.io/npm/v/start-server-webpack-plugin.svg)](http://npm.im/estart-server-webpack-plugin) | ||
[![version](https://img.shields.io/npm/v/start-server-webpack-plugin.svg)](http://npm.im/start-server-webpack-plugin) | ||
[![downloads](https://img.shields.io/npm/dm/start-server-webpack-plugin.svg)](http://npm-stat.com/charts.html?package=start-server-webpack-plugin) | ||
@@ -9,0 +9,0 @@ [![MIT License](https://img.shields.io/npm/l/start-server-webpack-plugin.svg)](http://opensource.org/licenses/MIT) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7788
101