The code in api.postProcessFiles doesn't work as written when the plugin is used in a new project (vue create instead of vue add). As far as I can tell, this is because vue-cli generator plugins execute against a virtual file tree before any files are created on disk. So, when creating a new projects, fs.move won't work because the files don't actually exist yet. However, if you manipulate the files object passed to the callback in api.postProcessFiles, the changes will be made for a new project.
The code in
api.postProcessFiles
doesn't work as written when the plugin is used in a new project (vue create
instead ofvue add
). As far as I can tell, this is because vue-cli generator plugins execute against a virtual file tree before any files are created on disk. So, when creating a new projects, fs.move won't work because the files don't actually exist yet. However, if you manipulate the files object passed to the callback inapi.postProcessFiles
, the changes will be made for a new project.