Repository navigation
Conversation
…ve to the workspace root The Vite-based dev server read `sslKey` and `sslCert` relative to the current working directory, so serving failed with `ENOENT` when `ng serve` ran from a subdirectory of the workspace and the paths in `angular.json` were relative. Resolve both paths against the workspace root, as the webpack dev server already does. The new dev-server `ssl` spec covers relative paths. It fails with `ENOENT` without this change.
There was a problem hiding this comment.
This should be done in https://github.com/angular/angular-cli/blob/main/packages/angular/build/src/builders/dev-server/options.ts
Similar to
andThere was a problem hiding this comment.
Code Review
This pull request updates the Vite dev-server configuration to resolve the sslCert and sslKey paths relative to the workspace root. Additionally, a new test suite has been added to verify this behavior. There are no review comments, and I have no feedback to provide.
… relative to the workspace root
… relative to the workspace root
0ae6773 to
08e9727
Compare
clydin
left a comment
There was a problem hiding this comment.
This breaks legitimate use cases such as:
ng serve --ssl --ssl-key "$HOME/.certs/key.pem" --ssl-cert "$HOME/.certs/cert.pem"
… relative to the workspace root
…sslCert` relative to the workspace root Previously, the esbuild-based dev-server passed relative `sslKey` and `sslCert` paths to Vite as is, so they were read relative to the current directory and `ng serve` failed with ENOENT when run outside the workspace root. The paths are now resolved against the workspace root, matching `@angular/build`.
thekhegay
left a comment
There was a problem hiding this comment.
lgtm, build-angular dev-server now resolves sslKey/sslCert from workspace root same as @angular/build, and new spec covers that path
The Vite-based dev server read
sslKeyandsslCertrelative to the current working directory, so serving failed withENOENTwhenng serveran from a subdirectory of the workspace and the paths inangular.jsonwere relative. Resolve both paths against the workspace root, as the webpack dev server already does.