如何使用托管Angular WebStorm运行配置。

问题描述 投票:0回答:1

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

angular-cli webstorm
1个回答
1
投票

你可以在WebStorm中创建修改npm脚本。package.json 因此,像

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

然后在水沟中使用现有的运行配置图标来运行这个脚本,或者在你的应用程序中直接指定参数。NPM 运行配置。参数。 字段,使用 -- --<option name> 格式(见 https:/docs.npmjs.comclirun-script#description),如 -- --host 0.0.0.0:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.