如何 运行 配置主机 Angular WebStorm

How to run configuration with hosting Angular WebStorm

我想知道是否可以通过修改 WebStorm 中的配置来 运行 ng serve --host 0.0.0.0 而不是 ng serve?如果是,怎么做?

您可以 create/modify 相应地 package.json 中的 npm 脚本,例如

"start": "ng serve --host 0.0.0.0"

然后在 运行 这个脚本的 gutter 中使用现有的 运行 configuration/icon,或者在你的 NPM 中指定参数运行配置,Arguments:字段,使用-- --<option name>格式(参见https://docs.npmjs.com/cli/run-script#description),如-- --host 0.0.0.0: