0

I was recently working on a Vue.js project and I am done with the "Beta-Version". I want to deploy my website to an online server and share it with the world. I used npm run build to generate the scripts in the dist folder, and now I want to upload the files to the server, but I doubt that all the files are necessary to be uploaded. I guess I should remove some files that don't effect the user experience.

The Question: What are the files that can be removed before deploying a Vue.js project?

Note: I'm not talking only about the dist folder, I'm taking about removable files and folders in the root project directory, that contains dist and package.json and node_modules.

8
  • You can safely remove all the .map files, nothing more. Commented Aug 7, 2018 at 16:14
  • @VladislavLadicky There are no files with this extension in the whole project directory.. Commented Aug 7, 2018 at 16:15
  • Then there is probably nothing to remove, all files in your dist folder are needed. Commented Aug 7, 2018 at 16:21
  • I don't mean the dist folder, I mean the whole project folder including package.json and node_modules and others.. Commented Aug 7, 2018 at 16:22
  • 1
    Ahh... So, delete from hosting all the files you uploaded. And then upload only the files located in dist folder. They are "dist-ribution" files, only files you need to upload on your hosting. Commented Aug 7, 2018 at 16:34

2 Answers 2

1

The purpose of build process is to put any and all files and nothing else necessary for deployment into a folder, in this case, dist folder. Oops. This was meant to be a comment.

Sign up to request clarification or add additional context in comments.

1 Comment

I did deploy only the contents of dist folder and it just worked fine, thanks.
1

You really shouldn’t delete any file in dist folder unless you know for sure you don’t need it. If you do know that certain file doesn’t belong, it shouldn’t be there to begin with. But unless you modified build portion to add something you don’t need, it most likely doesn’t contain any that shouldn’t be there.

4 Comments

I'm not talking about the dist folder only, I mean the whole project directory, including package.json and node_modules, I don't think I need all of these..
You only need to upload dist folder. So yes, you can skip uploading anything outside of dist folder.
Only the dist and the index.html?
index.html should really be inside dist folder with build process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.