How can the project created by vue-cli be deployed to the Ali cloud server?

as mentioned in the question, how to deploy the project I created with vue-cli to the Ali cloud server? do I need to install npm or yarn on the server? I think someone said to npm run build, directly and then throw the generated dist folder on the server.
ask for specific operation steps

Jun.04,2021

under your npm run dev directory, open a new command line, type npm run build, and you will see that there will be a dist folder under your project folder. Select all the files in it. Copy to the html folder of your nginx configuration


what I did at that time was
(1) npm run build generated dist folder
(2) upload the dist folder to the server
(3) configure the nginx, access path on the server to point to the index.html, under the dist folder so that the index.html under the dist folder can be displayed when accessing the address set in nginx.


in fact, the answers of the two people upstairs are both correct, but the emphasis is different.
in fact, since you know that files are generated with npm run build, you should also see that both js css and html files are generated, that is to say, no matter what system the server is, as long as your server has server software that supports http or https. I know that there are nginx and apache, as long as one of the two is installed. And cooperate with the access path, put the files you generated under the server or under the mapping path, start your server software, and then you can use the path you configured to access the project, so you need to figure out two things:
1, how to install nginx or apache, Baidu to search for this kind of article is very many;
2. There are also many articles on how to configure nginx or apache, Baidu.

figure out these two projects and deploy them

Why don't I tell you how to install and configure here? this is not something that is clear in one or two words, and I can't describe it clearly;


problem solved the project is actually accessible, but static resources can not be loaded, I can change the absolute path to a relative path, but there is a small problem is that I can not find picture resources, I am still studying.


Ali Yun now uses what batch uploads the dist-compiled directory

Menu