Skip to content

[Feature request] Ability to serve and run tests against pre-compiled output directory #5378

Closed
@itslenny

Description

@itslenny

There is currently no way to serve the site (or run tests) against the result of a previously executed ng build. This is problematic for a few reasons explained in detail below.

This is a continuation of the discussion started here: #4975

ATTN: @johnpapa / @filipesilva

Motivation

  • Consistency - There are some inconsistencies between ng serve and what ng build places in the dist folder. For instance, ng serve serves everything in the root of the src directory which means that static assets can be loaded from src that will not be available after deployment.

  • Debugging - Sometimes it's useful to be able to serve the app exactly as it will be deployed. I've used this when debugging AOT related issues that only present at run-time in a production build. There are other options for this scenario, but running simple http server in the dist folder was the easiest option, but I think ng-cli should be able to use it's included server for this instead of me needing to use another http server.

  • Deployment pipeline - currently my continuous deployment is building the app 3 times. Once each for ng test, ng e2e, ng build. Ideally I could run ng build then run the tests against the code in the dist folder.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions