-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flag to prevent "dist" folder from being deleted during ng build #5925
Comments
Could we just have a flag for overwrite dist content and a proxy for live reload? |
Wow ~ this ticket is describing exactly what I was going through the other day ! xD I would second the motion of not deleting the |
+1 |
I didn't get the message that the --delete-output-path flag was added for this scenario....thanks! Appreciate it. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.0.0
node: 6.10.2
Same result as below for Windows or OSX
Repro steps.
I'm hooking up a Docker nginx container to the "dist" folder through a volume with the following command. Note that $(pwd) would represent the dist folder in this case (the working folder):
docker run -d -p 8080:80 -v $(pwd):/usr/share/nginx/html nginx:alpine
Hitting http://localhost:8080 works fine and the CLI sample app code/bundles in the dist folder work fine and are displayed in the browser.
However, if I run ng build again the dist folder seems to be deleted which then breaks the Docker container volume (since the original host folder that the container volume pointed to is now changed) and nginx will give a 404. I've sh'd into the nginx container and verified that the "html" folder isn't found (which means the "dist" folder isn't found probably due to the volume link breaking - that's what I suspect anyway). For devs wanting to work with "real" servers (nginx, Apache, HAproxy, etc.) to do updates to the CLI generated source code via Docker containers and volumes this presents a challenge.
The log given by the failure.
No failure in the CLI. The failure occurs with the Docker volume created between the nginx container and the dist folder on the host machine. Deleting the dist folder seems to be breaking the docker container volume link.
Desired functionality.
It would be nice to either leave the dist folder there and only delete the contents when performing a new "ng build" or to provide a flag that would allow us to leave the dist folder there for this type of scenario.
Mention any other details that might be useful.
Repo that runs this scenario plus several other containers can be found at https://github.com/DanWahlin/Angular-Docker-Microservices.
If you perform the steps listed in the readme it should fire up fine the first time. But, if you run an ng build again, the dist folder is deleted which seems to break the Docker volume link and nginx will then give a 404 since the original host folder was removed (at least I think that's why it's breaking).
The text was updated successfully, but these errors were encountered: