| 22 | } |
| 23 | |
| 24 | function configureArguments(config: Config): string[] { |
| 25 | let args = [config.angularCliPath, 'serve', config.angularAppName]; |
| 26 | |
| 27 | if (!config.angularAppName) { |
| 28 | throw new Error(`Please provide Playground's appName in your angular-playground.json file.`); |
| 29 | } |
| 30 | args.push(`--host=${config.angularCliHost}`); |
| 31 | args.push(`--port=${config.angularCliPort}`); |
| 32 | // need to set webpack.devServer.public via ng serve --publicHost flag (https://stackoverflow.com/a/43621275) |
| 33 | |
| 34 | if (config.angularCliAdditionalArgs) { |
| 35 | args = args.concat(config.angularCliAdditionalArgs); |
| 36 | } |
| 37 | return args; |
| 38 | } |