如何在共享托管环境中部署vue应用? [英] how to deploy vue app in the shared hosting environment?

查看:78
本文介绍了如何在共享托管环境中部署vue应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在共享主机服务器上部署我的vue应用程序。我该怎么办?
到目前为止,这有点令人困惑。我将需要表达js还是可以像普通的html网站一样直接上载它?

I would like to deploy my vue application on shared hosting server. How should I do it? Its a bit confusing as of now. Will I need express js for it or I can directly upload it like the normal html site?

推荐答案

这是我部署我的方式。

Here's how I deployed mine.


  1. 转到项目文件夹-> config-> index.js文件,确保assetsPublicPath:指向public_html路径

  1. Goto to your project folder -> config -> index.js file ensure that the assetsPublicPath: is pointed to the public_html path of your shared hosting account.

运行 npm run build 命令。

转到项目文件夹,将dist文件夹的内容粘贴到cpanel的public_HTML文件夹中。

Go to your project folder copy the contents of the dist folder paste them in the public_HTML folder of your cpanel.

现在,我相信有更好的方法可以做到这一点,请有更好方法的人告诉我们。

Now I am sure there are better ways to do this, please anybody with a better way should let us know.

这篇关于如何在共享托管环境中部署vue应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆