Skip to content

Docs Feature Request: Serving from /dist #4290

Closed

Description

@johnpapa

Quick Ask

Please add something in the CLI docs that explains how to run the app from the /dist folder. Something that explains how to install lite-server and run it on that folder as a validation or gut-check.

Why? This will help skeptical folks (like me) validate that the /dist files will indeed run properly. The existing ng serve commands run in memory.

Details

from my chat with @filipesilva ...

When I hear build i think that we are going to process the files and prepare them to be served. But not actually serve them. And I think there is a very clear distinction between a dev and prod build. and each of those could be either on disk or in memory. I’m not suggesting these flags, but I am using them to further explain ...

#these dont exist .... just for clarification on how i was thinking ...
build —dev —in-mem
build —dev —disk
build —prod —in-mem
build —prod —disk

then when i serve, it gets interesting …. some tools consider serve as just serving. some consider it as building and serving. For us we have … ng serve which builds a dev build in memory and serves it. then we have ng serve —prod which builds a prod build in memory and serves it. Always in mem.

If we wanted, we could have ...

#these dont exist .... just for clarification on how i was thinking ...
ng serve —dev -in-mem
ng serve —dev -disk
ng serve —prod -in-mem
ng serve —prod -disk

again, im not suggesting all 8 of these. just thinking out loud

The way it actually works , we only have these …

ng build 

#prod build copied to /dist folder
ng build —prod

#dev build in memory and served
ng serve 

#prod build in memory and served
ng serve —prod 

I think those are fine … but I do see myself wanting to try a serve off disk … but we have no way of doing that with CLI. And I think it is perfectly fine to not include this in the CLI ... as long as we explain in the docs how people can run it on their own with something like http-server or lite-server.

cc // @Brocco @wardbell

Activity

  1. johnpapa commented on Jan 30, 2017

    @johnpapa
    ContributorAuthor

    I propose we also add to the docs that when you run ng serve that this is entirely in memory, and not files in dist are affected

  2. added a commit that references this issue on Jan 30, 2017
  3. added a commit that references this issue on Jan 31, 2017
  4. added 2 commits that reference this issue on Mar 8, 2017
    bcbd37c
    832eca5
  5. added a commit that references this issue on Mar 9, 2017
    afbddfe
  6. added a commit that references this issue on Apr 12, 2017
    d91a2ad
  7. jaesung2061 commented on Apr 26, 2017

    @jaesung2061

    Or notify the user at the terminal when they run the command?

  8. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Sep 7, 2019
  10. added a commit that references this issue on May 29, 2026
    27c90fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions