-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Clean to remove content of dist folder instead of removing and recreating the dist folder (issues with docker mount on dist folder) #6208
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
Comments
Workaround maybe like this "scripts": {
"build-docker": "vue-cli-service build --mode 'development' --watch --dest dist/output
} then the 'output' folder will be removed and recreated, you can consume it |
@fangbinwei This is a great idea. Works like a charm. This basically behaves the same as our workaround with prepending It is no big deal and ok - I was just surprised. Conclusion: What do you think should we do with this issue here? Should we just close it , as there is a workaround? Or would it be good to add a similar suggestion to the docs somewhere? |
I believe we could enhance the behavior of CLI ( by using
I have no idea now, there is an issue #6182 to track this problem |
can we backport this please in 4.5 |
Version
4.5.10
Environment info
Steps to reproduce
We are running vuecli environment inside a docker container.
We are mounting a host folder to the destination folder (dist) in our docker-compose.
package.json:
docker-compose.yml:
Now build via:
vue-cli-service build --mode 'development' --watch --dest dist
What is expected?
We expected that all the files and folders inside the "dist" folder are removed. Similar to
cd dist && rm -rf *
What is actually happening?
The dist folder itself is removed, not just its contents.
This subtle difference is a problem when you have a docker mount specifically on that
dist
folder.Because removing this dist folder from within the container breaks the mount and then the built files are not visible on the host anymore. You need a container restart. This all breaks a smooth development flow in this particular scenario.
Our current workaround is to add a
--no-clean
and do arm -rf dist/*
initially.But this does not work with the
--watch
option, as it is only done once initially.The text was updated successfully, but these errors were encountered: