Skip to content

Docs Feature Request: Serving from /dist #4290

Closed
@johnpapa

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

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