Exclude files from being removed while building vue using Vue CLI

vue-cli
webpack

#1

Hi,

I have an edge case here where I’m building vue app into my “already-used-by-other-app” public directory.
When I run build, the files of the other app are removed. I’d like to somehow exclude those files or folders from being removed while building the Vue App. Can it be implemented somehow by chaining webpack?

Would appreciate any help. Thank you.


#2

No. You will have to find some workaround, i.e. build into a different directory and then run mv /temp-dist /you-target-dir or something.

That still leaves you with the challenge of removing the previous build’s files that may no longer be needed from /your-target-dir

Maybe something like this plugin may be helpful in getting a list of generated files and using that to remove old ones / move around new ones.


#3

Right, I see. Thank you for the swift response.